“We look forward to working with him to help nurture that raw talent and fulfill his potential. Eric is at the right club to continue his development.”
Bailly joined Villarreal from Espanyol in January 2015 as a replacement for Arsenal-bound Gabriel and went on to make 47 appearances for the Spanish club.
He said: “It is a dream come true to be joining Manchester United. To play football at the highest level is all I have ever wanted to do.
“I want to progress to be the best that I can be and I believe working with Jose Mourinho will help me develop in the right way and at the right club.
“I am looking forward to meeting my new team mates and to starting this new chapter of my life.”