United had agreed a deal in principle to sign the 21-year-old from Swansea last week, with the player having completed a medical and agreed personal terms.
Sky Sports News understands United will pay Swansea an initial fee of £15m, plus £3m in add-ons, for James – who becomes Ole Gunnar Solskjaer’s first signing as the club’s manager.
“Daniel is an exciting young winger with lots of skills, vision, exceptional pace and a good work ethic,” United manager Ole Gunnar Solskjaer told the club’s official website.
“He had a great season with Swansea City and has all the attributes needed to become a Manchester United player.
“We are delighted he has signed with our club and we are all looking forward to working with him. This is the perfect environment for Daniel to continue his development.”
James is delighted to have sealed his move to Old Trafford but admitted the move is “tinged with sadness” after his father passed away last month.
“This is one of the best days of my life and a challenge I am really looking forward to,” he said.
“The Premier League is the best league in the world and Manchester United is the perfect place for me to continue to develop as a player.
“This is an incredibly proud moment for me and my family, however, it is tinged with sadness that my father isn’t able to share this experience with us.
“I am looking forward to working with Ole, meeting the team and getting started.”