The Argentine was sacked by Saints back in March after guiding the side to only one win in 17 matches, and was promptly replaced by Mark Hughes who ensured Premier League survival.
Pellegrino has experience in the Spanish league having previously managed both Deportivo Alaves and Valencia in the top-flight, and will make his return ahead of next season.
June 2, 2018
He will take over from Asier Garitano, who will be heading up Real Sociedad instead next season. Leganes ended last season in 17th spot in La Liga and reached the Copa del Rey semi-finals.
A club statement read: ''Club Deportivo Leganes and Mauricio Pellegrino have reached an agreement for the Argentine coach to lead the club the next season.''
''The coach has signed his contract on Friday morning that links him to the club until June 30, 2019."