The Swedish defender struck from a corner just when it looked as though Blackburn were to be rewarded for a determined performance by taking the three points.
After falling behind to a 24th minute effort by Juan Pablo Angel, Rovers hauled themselves back into the picture.
First captain Barry Ferguson scored a neat equaliser in the 30th minute before Brett Emerton pushed Blackburn's noses in front just after the hour.
An attacking contest could have gone either way with a series of chances created at both ends.
Villa went in front when poor defending allowed Angel to turn smartly before firing a right-foot shot beyond Brad Friedel after the Colombian had been set up by Ulises De la Cruz.
Great play from the outstanding Paul Dickov set up Ferguson for the equaliser, the Scottish midfielder nipping in unmarked to deflect the ball beyond Thomas Sorensen.
Blackburn debutant Youri Djorkaeff was starting to pull the strings in midfield and the Frenchman, who is now 36, went very close to putting the home side in front with a shot that drifted just wide.
Gareth Barry should have given Villa the lead early in the second half but he blazed the ball high over the bar from a great position.
Angel then had a headed effort disallowed for offside just seconds before Blackburn made it 2-1 with a goal of stunning quality.
Ferguson and Djorkaeff linked up well down the left and Brett Emerton hit a first-time shot on the run which flew just inside the near post.
Sorensen was then forced to make a good block to keep out Dickov's late effort while at the other end Friedel's acrobatics denied Carlton Cole.
Blackburn's inability to defend a right-wing corner proved their downfall with Mellberg's 80th minute equaliser but there was still time for Ferguson to almost win it for the home side with a cracking shot that was well-saved by Sorensen.
MAN OF THE MATCH: Barry Ferguson (Blackburn) - The Scottish midfielder scored Rovers' first goal, helped to create the second and was behind most of his side's best creative moments.