Celta Vigo sacked coach Eduardo Coudet and appointed Carlos Carvalhal in his stead on Wednesday after a bad string of results which left them 16th in La Liga, one point above the relegation zone.
"Carvalhal will be Celta coach until June 2024 after reaching a deal with the club," said the Galician side in a statement.
"The Portuguese coach arrives with a lot of experience, and having enjoyed noteworthy success.
"He left an indelible imprint at Sporting Braga, a team with whom he won the Portuguese cup, and qualified for several European competitions."
The 56-year-old's most recent job was in Saudi Arabia as coach of Al Wahda, and he has previously coached Sporting Lisbon, Besiktas and Sheffield Wednesday, among many other teams.
Celta have lost four of their last five games in La Liga, only managing a draw in the other, against Getafe.
"Coudet and his technical team have left Celta after a fruitful era," the club wrote in another statement, earlier Wednesday.
"The Argentine coach leaves after two years during which the club performed well. (When he arrived) the club was second from bottom, and that season the team finished eighth after a spectacular comeback.
"Last season, Celta finished 11th. The club, after this difficult decision, wants to offer Coudet and his assistants their most sincere gratitude for what they gave, the honesty and professionalism they showed from the first day of their time in Vigo."
The Argentine coach, who replaced Oscar Garcia at the helm in November 2020, had a contract until 2024.