Kammala jumla mai zuwa: Sarkin sarakuna da kansa ya shiga cikin yakin da aka yi wa 'yan Sweden, wanda ya ƙare tare da rashin nasara a
Yaƙin Jankau a ranar 6 ga Maris, 1645. Sojojin Sweden a karkashin Lennart Torstensson sun ci gaba zuwa Vienna. Don ya ƙarfafa mutanen birnin, sarkin ya zagaya birnin a cikin babban jerin gwano da siffar Budurwa Maryamu. Sa'ad da sojojin Sweden suka matso kusa, Ferdinand ya bar birnin. Archduke Leopold Wilhelm ya yi nasarar fitar da abokan adawar. A wasu lokatai, Ferdinand ya yi nasara wajen sa Yarima George I Rákóczi na Transylvania, abokin Faransa da Sweden, ya goyi bayansa. A cikin 1645 "Salama na Linz" Sarkin sarakuna ya ba da tabbacin haƙƙin wakilcin mulkin mallaka na Hungary da 'yancin addini ga Furotesta, wanda ya hana Counter-reformation da mulkin Absolutist na gaba a Hungary.