Bilbao said earlier that they had rejected a bid for the 24-year-old from United valued at around 36 million euros (USD 49 million), the same as his buyout fee, but the transfer was concluded later in the day. (Agencies)
"Signing for Manchester United is a dream come true," the Spaniard told the club website.
"I played at Old Trafford for Athletic in the Europa League and it was one of the highlights of my career so far,” he added.
"I have joined United to do all I can to help the team reach the club's objectives. I'm excited to now be living in Manchester and I can't wait for my first game in United's famous red shirt,” he said.
Herrera spent three seasons at Bilbao after joining his hometown club from Real Zaragoza in 2011.
He helped them qualify for the Champions League next season, a competition his new club will miss out on after they finished seventh in the Premier League.
United attempted to buy Herrera last year under then-manager David Moyes but the bid ended in farce amid media reports that three men attempting to broker the deal were imposters.
"Ander is a fantastic young player with great energy and creativity," said Ryan Giggs, assistant to new manager Louis van Gaal.
"We believe him to be one of the brightest young prospects in Spain and I am certain he will be a big hit with the United fans. I'm delighted he has made the decision to come to Manchester and play his part in the club's future,” he added.
Herrera has been capped at age-group level for Spain but has not featured for the senior team.
Bilbao said the player had bought himself out of his contract.
"Athletic should aspire to have players whose first priority is to defend the club's shirt," president Josu Urrutia told Bilbao's website.
"In that sense Ander Herrera's decision is not in line with this concept and is a disappointment for the club,” he added.
The deal is subject to international clearance and there is the option for the contract to be extended for a further year.
Bilbao were fourth in La Liga last season.
Bilbao said earlier that they had rejected a bid for the 24-year-old from United valued at around 36 million euros (USD 49 million), the same as his buyout fee, but the transfer was concluded later in the day.