James has signed a five-year contract, with the option to extend for a further year.
Reports said the initial fee was about £15 million ($19 million).
James, a graduate of the Swansea academy, scored five goals in 38 appearances during an impressive 2018-19 campaign with the Championship side.
Solskjaer told United's website: "Daniel is an exciting young winger with lots of skills, vision, exceptional pace and a good work ethic. 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."
The transfer comes less than a month after the death of James's father.
James said: "This is one of the best days of my life and a challenge I am really looking forward to. 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."