The World Player of the Year scored twice from the penalty spot, his 14 goals in the competition so far bettering the previous record by two. The brace took his season tally in all competitions to an astonishing 58.
Messi helped set up the decisive third for Andres Iniesta just after the break, assuring the holders of a place in a fifth successive Champions League semi-final, matching a record achieved by arch-rivals Real Madrid between 1956 and 1960.
"We deserved to qualify and we are very proud to be in the semis for a fifth time," Barca coach Pep Guardiola said.
"We had 21 shots on target and that against an Italian team.
Barcelona will play the winners of the quarter-final tie between Chelsea and Benfica which the London side lead 1-0 going into the second leg at Stamford Bridge on Wednesday.
"I have no preference for the semis, the two teams would both be very tough," Guardiola added.
The game kicked off in a crackling atmosphere, Barca leaving three at the back and racing forward at every opportunity which gave Milan plenty of opportunities for counter-attacks.
Messi had already come close to scoring twice when Luca Antonini slid into the back of him in the area and bundled the Barca forward over for the first penalty after 11 minutes.
Milan goalkeeper Christian Abbiati guessed right but Messi's spot-kick was tight in the corner.
The game ebbed and flowed, the visitors showing more ambition from the first leg and looking to play long balls up to powerful former Barcelona striker Zlatan Ibrahimovic.
It paid dividends when the tall Swede slipped a pass into the area for Antonio Nocerino to fire in the equaliser after 32 minutes.
Barca were awarded a second penalty in the 41st when Alessandro Nesta pulled Sergio Busquets back by his shirt at a corner, a decision that was hotly disputed by the Milan players. This time Messi sent Abbiati the wrong way from the spot.
"We made a mistake for the first penalty, but at the second we have seen the referee give the decision far too easily to Barcelona," Milan coach Massimiliano Allegri complained.
Barca sought to control the game more after a frenetic first half and got the breathing space they wanted in the 53rd minute.
Messi arrowed across the edge of the area and when his shot was blocked it broke to Iniesta, who showed great composure to dink it over the diving keeper.
"Barcelona is the best team around, we knew that," Milan midfielder Massimo Ambrosini told Italian TV. "I thought we started well but they played better in the second half.
"We could maybe have done a bit more tonight but over the two matches I don't know how much more we could have done."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.