Fire incidents involving lithium-ion batteries during transportation have become increasingly frequent, causing significant property damage and posing serious health risks to individuals nearby. Despite growing concerns over these incidents, the effects of spatial confinement during transportation on battery thermal runaway and fire behavior remain insufficiently understood. In this study, considering that batteries during transportation are often in space-limited scenarios, a comparative experiment was conducted to investigate lithium iron phosphate batteries' thermal runaway characteristics and fire hazards in semi-confined space with top openings. The research demonstrates that semi-confined space accelerates the thermal runaway process and exacerbates the fire hazard. Furthermore, as the state of charge increases, the severity of thermal runaway and the associated fire hazard escalate. Notably, as the size of the top opening increases, the battery deflagration transitions from extinction to stable continuous combustion, with gas toxicity initially increasing and then decreasing. This paper emphasizes the critical role of semi-confined space in influencing the fire behavior of lithium-ion batteries. It underscores the importance of effective smoke venting designs to mitigate the risks of battery thermal runaway during transportation. These findings can provide valuable insights for formulating regulations on lithium-ion battery transportation and designing smoke venting systems for transportation containers.