The 26-year-old midfielder will join up with his new club on Thursday for the start of pre-season training, after opting to join the Saints amid reported interest from other Premier League clubs.
Southampton boss Mark Hughes said: “Stuart is a player who we have admired for some time, and I am delighted we have been able to bring him here, especially given the competition we faced to sign him.
“We have strong players in the squad and it is important we build on that by adding different qualities.
“It is important we add a greater goal threat to the team as a whole, and to our midfield specifically, and Stuart’s record of scoring and creating makes him an extremely exciting addition in that area.
“He has shown tremendous drive to improve and has also displayed a great desire to be a part of what we are trying to achieve here, and I believe he will be a real asset to the squad in the years ahead.”
Scotland international Armstrong added: “Southampton seems a really good fit for me. Watching from afar, I really enjoy the attractive football that they play and I’m very happy to be here.
“Every season, I put demands on myself to create and score goals. I hope going forwards from here that it will be the same this term at St Mary’s.
“I’m looking forward to meeting everyone and I’m very excited to get started. It’s a four-year contract; there will be a lot to learn and I want to hit the ground running.”
Armstrong helped Celtic to back-to-back domestic trebles, and played 142 times for the Hoops in three and a half seasons, including 25 European appearances.
He scored 27 goals for the Parkhead side, including 17 alone in the 2016/17 season.