The 52-year-old Austrian was first handed the Saints job in December 2018, taking over from Mark Hughes after a troubled start to the season and guiding them to safety in the Premier League.
Hasenhuttl’s position came under threat earlier in the 2019/2020 campaign especially when Southampton suffered a record-equaling 9-0 home defeat to Leicester City.
The former RB Leipzig manager has however managed to turn things around at the Saint Mary’s stadium, and they were lying in 14th position on the league log, seven points clear of the relegation zone, when football was halted in March because of the Coronavirus pandemic.
Hasenhuttl told Southampton's website: "This, for me, was a simple decision. Simple because of the relationship that I have built with the club, the players and the fans, and also because of the relationship they have built with me too.
"For me, this is an important step in the journey. My players, our staff, and of course the supporters must understand my commitment to this club and to what we are trying to build together.
"We value the same philosophies, and this is a big part of why I want to stay here, and I hope we can share in some very successful moments moving forward."
Saints chief executive Martin Semmens added: "There has never been any question in my mind that Ralph is the right man to lead our club, and I look forward to working in partnership with him over the next four years.
"I know there is no one who will work harder to bring success back for our fans."