Andy Carroll has ended his Liverpool nightmare after West Ham confirmed they had signed the England striker on a permanent basis.
The deal to bring the 24-year-old to Upton Park on a permanent basis could cost the east London club up to £48.5m.
Carroll underwent a medical last night after flying back from holiday in the United States with chairman David Gold revealing he had passed.
Gold tweeted: "We managed to bring Andy's medical forward to this evening and I am delighted to informed (sic) you that he has passed with flying colours."
Carroll has agreed a six-year deal worth £100,000-a-week with an option for a further two in the club's favour. Should the 24-year-old see out the six years of his contract then he will cost the club £31m in wages. Together with his fee, which is understood to be £15.5m plus a further £2m in add-ons, it means a potential outlay of £48.5m for a player who scored seven goals in 25 appearances while on loan at the club last season.
Speaking to West Ham's official website, Carroll said: "It's fantastic for me to be here. I really enjoyed last season, and that shows in me coming back and making it permanent," said Carroll.
"The fans, the lads and the Club itself has been great to me, and what I wanted to do was come back here and play football.
"Since the end of the season I've had a lot of time to think, I've missed it and that's why I'm back. Getting promoted the season before last, then finishing where we did - we did great, and it can only get better for us.
"The way the Club's being run, obviously getting the new stadium and everything like that, it's only going up."
In view of his previous injury problems, Carroll underwent an extensive medical. He passed the tests despite a heel injury suffered towards the end of last season, ruling him out of England's friendlies against the Republic of Ireland and Brazil, and expected to sideline him for up to four months.
It means a big loss for Liverpool who paid Newcastle a British record £35m for the striker just two and a half years ago. However, as soon as Brendan Rodgers arrived at Anfield last summer, it became clear Carroll had no future on Merseyside.
A statement on the club's website read: "Everybody at Liverpool FC would like to wish Andy all the best for the future."
Hammers boss Sam Allardyce made signing Carroll permanently his priority during the close season and will be delighted the deal was completed after extensive talks.
Allardyce wants at least one more striker following the departure of Carlton Cole and has been linked with Tottenham’s Emmanuel Adebayor.
In view of the finance involved in the Carroll transfer, though, it is thought likely the Upton Park club would only be interested in a loan deal for Adebayor.
West Ham are expected to sign Stockport midfielder Danny Whitehead after the teenager impressed on trial last season while striker Robert Hall is wanted by Bolton and Nottingham Forest.