The Yangtze finless porpoise (Neophocaena asiaeorientalis asiaeorientalis) is critically endangered and has suffered from extensive habitat loss and fragmentation. Knowledge of its habitat preference could assist the conservation of the species and associated ecosystem. In the present study, spatiotemporal variations and driving factors of habitat use of a Yangtze finless porpoise population were studied in a 30-km section of the Yangtze mainstream. Seasonal variation in porpoise occurrences was observed based on visual surveys conducted from 2022 to 2023, with five surveys during the dry season and seven surveys during the wet season. Biological and environmental factors were synchronously sampled in both seasons. The maximum entropy model (MaxEnt) was applied to get the effects of biological and environmental variables on porpoise habitat preference. Within the study area, high-suitability habitats of the finless porpoises accounted for 19.0% and 15.4% of the area during the dry and wet seasons, respectively. The high-suitability habitat shifted from the mainstream in the dry season to the sandbar head and tributary area in the wet season. In the dry season, variables influencing the distribution were phytoplankton biomass, water velocity, and zooplankton biomass, which contributed 97.05% variation in the MaxEnt modeling. In the wet season, water depth, surface water temperature, and zooplankton biomass accounted for 97.69% variation of the distribution. Above results highlight that food availability plays an important role in porpoises distribution regardless of seasons, particularly in the dry season. This is because plankton is the primary food source for filter-feeding and omnivorous fish, especially those in the upper-middle layer which are frequently preyed on by finless porpoises. Suitable areas for finless porpoises, particularly those with high suitability, differed significantly across seasons at a fine-scale in the Yangtze mainstream. Seasonal variations in habitat were driven by different factors. But food availability plays an important role in porpoises distribution regardless of seasons, particularly in the dry season. These results suggest prioritizing conservation of the finless porpoise in the dry season when fish resources are relatively scarce. Measures including monitoring and evaluating prey resources should be considered. More attention should also be paid on management of shipping in the dry season given that the high-suitability habitat of the finless porpoises shifts to the mainstream.