As part of the loan deal Villarreal will reportedly pay Milan €2.5 million, with the purchase option a further €15.5m.
The forward will be presented to fans and the media by Villarreal on Thursday and has been given the number nine shirt at Estadio de la Ceramica.
Milan are also expected to sign Nikola Kalinic from Fiorentina and have seen youngster Patrick Cutrone emerge, leaving the Colombia international seeking a move to ensure regular football in a season that will conclude with the World Cup in Russia.
Bacca spent two years at Milan after joining for a reported €30m from Sevilla. He scored 31 Serie A goals over his two seasons at the club and turned down a lucrative move to China in February, insisting he had chosen his happiness over money.
Previously, he spent two campaigns with Sevilla, scoring a total of 34 league goals and winning the Europa League in both seasons.