David Moyes said “it feels great to be home” after he made an unlikely return to West Ham, charged with the task of saving the club from relegation for the second time in three seasons.

Eighteen months after he was replaced by Manuel Pellegrini, the 56-year-old has been given a contract until the end of next season after the co-owners, David Sullivan and David Gold, acted swiftly following the 2-1 defeat by an under-strength Leicester side on Saturday.

We are pleased to confirm that David Moyes has returned to the Club as first-team manager. pic.twitter.com/Y2fxo5hTCE — West Ham United (@WestHam) December 29, 2019

Pellegrini was dismissed 90 minutes after their fourth successive home defeat in the league left West Ham one point and one place above the relegation zone. Moyes’s first match will be against fellow strugglers Bournemouth at the London Stadium on New Year’s Day and the former Everton manager believes he has inherited a superior squad to when he succeeded Slaven Bilic in November 2017.

“It’s fabulous to be back,” said Moyes. “It feels great to be home. I’ve missed being here because I really enjoyed it. I enjoyed being around the stadium and I loved being in this part of the world and I missed the club, so I can’t wait to get started.

“I’m feeling very proud that I’m back here at West Ham. But I think more importantly I’ll be looking to see what I can do and what I can make improvements to, how we can get some wins with the players and how we can get some quick wins on the field as well. I do believe that the squad of players I’ve got here is a better squad of players than when I took over before, so I am looking forward to working with them.”

He added: “I think there’s got to be a short-term goal for us just now to get the wins to get us away from the wrong end of the league and what we’re going to do over the next six months, then what we’re going to do over the next period as well. The start is really focusing on the immediate games.”

Moyes, who was linked with Everton before Carlo Ancelotti’s appointment at Goodison Park, has been out of work since leaving West Ham. He did not leave on good terms, however, having struggled to convince the board he was worthy of a long-term deal. West Ham began a search for a “high‑calibre figure” and Pellegrini was hired on a three-year contract worth £7m a year.

Manuel Pellegrini is expected to receive around £10m in compensation after his sacking. Photograph: David Klein/Reuters

Moyes does not hold a grudge against West Ham and he can count on support from within the boardroom. Gold, who is a big fan, thought it was a mistake to let Moyes leave in the first place and has been pushing for a reunion for a while. The problem in 2018 was that Sullivan, who holds far more power than Gold, had a different vision from Moyes and wanted a manager who played attractive football and could attract exciting players.

Nonetheless, Sullivan acknowledged that Moyes had illustrated his capabilities during his first spell and had earned his second opportunity.

“David proved in his short time with the club that he was capable of getting results and we believe he will start moving the club in the right direction once again,” he said. “We are delighted to welcome David back – he knows the club well and he built strong relationships during that time which will be crucial for the work that needs to be done going forward.”

While Moyes’s return is unlikely to sit well with fans who have grown disenchanted since the move to the London Stadium, he can point to how he revived Marko Arnautovic during his first spell, not to mention the fact he was working with a limited and unbalanced squad.

West Ham are crying out for a manager to organise a leaky defence and they need a more solid structure away from the pitch. They need a manager with a record of building sides; someone to give them stability. Before the end of his first spell Moyes had plans to emulate his successes at Everton by turning West Ham into a top-eight club. He spoke about the need for better training facilities and pushed for greater control over signings. He wanted the club to be cannier in the transfer market.

Moyes, who could ask Alan Irvine, Chris Woods and Stuart Pearce to be part of his backroom staff, inherits a badly underperforming squad. West Ham tried to be patient with Pellegrini, especially after he lost Lukasz Fabianski to a serious hip injury in September, but successive defeats against Crystal Palace and Leicester over Christmas convinced the club to act.

The loss of Fabianski, who returned in goal against Leicester, proved calamitous. The goalkeeper’s deputy, Roberto Jiménez, put in a string of awful displays, destroying the team’s confidence and raising doubts over Pellegrini’s judgment. The signing of Roberto on a free transfer last summer was down to Pellegrini, who was handed £100m to spend in the summer of 2018, and Mario Husillos.

Husillos, who was Pellegrini’s pick as director of football rather than that of the club, has been under pressure for a while. Roberto is not the only recent signing who has flopped. Andriy Yarmolenko, a £17m buy from Borussia Dortmund, is up for sale. Carlos Sánchez and Albian Ajeti have also disappointed, Sébastien Haller has struggled up front since his £45m move from Eintracht Frankfurt last summer and Pellegrini’s insistence on signing Jack Wilshere on a free transfer has backfired. Wilshere is rarely fit, leaving West Ham’s ponderous midfield short of options.