Madrid: Real Madrid are done searching for a new coach. The club said on Tuesday they are sticking with Santiago Solari, giving him a permanent contract until June 2021.

Solari was appointed as the interim coach about two weeks ago to replace the fired Julen Lopetegui and was rewarded with a long-term deal after leading the team to four straight victories, putting it back on track in the Spanish league and the Champions League.

The 42-year-old Solari is a former Argentina international who played for Real Madrid in the early 2000s. He had previously coached Madrid's "B'' team.

Also read: Real Madrid sack coach Julen Lopetegui after Barcelona rout

There had been speculation about Antonio Conte and Roberto Martinez as possible replacements for Lopetegui, but Solari gained the club's confidence — and the approval of fans and players — with his impressive start in charge of the main squad.

Madrid outscored their opponents 15-2 in the four matches under Solari. They had lost five of their last seven games with Lopetegui in command, being outscored 13-4.

Solari was virtually unknown outside of Spain and few saw him as a front-runner for the Madrid job, but he has always been well-regarded within the club.

He got the demanding Madrid fans on his side by making some popular choices early in his stint, including giving more playing time to Vinicius Junior, the young Brazilian who arrived amid high expectations but had been relegated to the "B'' team under Lopetegui. The 18-year-old forward played well every time Solari put him in, showing he was indeed ready to be with the main squad.

Players who had been struggling under Lopetegui also began thriving after Solari took over. Karim Benzema was one of them, scoring four goals in the four victories under Solari. The French striker had scored only once in the last 10 matches before Lopetegui was fired.

The club had registered Solari as its permanent coach on Monday because local regulations prohibit teams from having an interim coach for more than two weeks.

Madrid officials had been praising Solari but had not said they stopped looking for a full-time replacement for Lopetegui, the former Spain coach who was fired following a 5-1 loss to Barcelona at Camp Nou Stadium.

The club said the decision to keep Solari was made after a meeting of the board of directors on Tuesday.

The coach helped Madrid move from ninth to sixth in the Spanish league, four points behind Barcelona. He also put the three-time defending European champions back at the top of its group in the Champions League, tied on points with Roma.

Solari helped Madrid win the 2002 Champions League as a player as was involved in the build-up that led to Zinedine Zidane's superb winner in the final.

The former midfielder also played for River Plate, Atletico Madrid and Inter Milan.

He had been coaching Real Madrid's "B'' team since 2016, taking over not long after Zidane left to coach the main squad.

Madrid's next match is at Eibar in the Spanish league on November 24, after the international break.