Mechanically robust lightweight polyimide foams (PIFs) with anisotropic pore structures were successfully prepared using microwave-assisted foaming and thermal imidization. The foaming behavior of polyester ammonium salt powders was assessed by rheological and TG-FTIR analyses. The release of volatile gases (e.g., H 2 O, tetrahydrofuran, and methanol) between 85 and 150 °C led to the directional growth of foam pores during microwave treatment, which was critical for endowing PIFs with excellent thermal insulation and mechanical properties. The use of 4,4′-diaminobenzanilide (DABA) as the copolymerization reagent enhanced the compressive strength@50% strain (92.25 kPa) in the vertical direction (i.e., pore growth direction) and high elasticity in the horizontal direction (compression response rate reached up to 98.95%). The PIFs demonstrated exceptional thermal stability under both inert and air atmospheres. Meanwhile, PIFs exhibited anisotropic thermal insulation behavior, exhibiting a thermal conductivity as low as 0.0264 W/(m•K) in the horizontal direction (i.e., perpendicular to the pore growth direction), which was ideal for thermal insulation purpose under high temperatures. Therefore, PIFs with excellent mechanical performance and exceptional heat resistance and thermal insulation properties were facilely prepared, which show promising applications in high-end engineering sectors.