Portuguese international Simao had shot Atletico into a first half lead but David Fuster equalised early in the second period and both sides had chances before Llorente bundled in a 90th minute header to stun the home fans at the Vicente Calderon.
It boosts Villarreal's chances of European football after enduring the worst start in their history and the club climb to 10th. For Atletico it was a seventh defeat of the campaign and they lie just a point above the relegation zone.
Atletico were without top-scorer Sergio "Kun" Aguero due to injury but winger Simao opened the scoring on 36 minutes. Simao ran onto a great pass from Jose Antonio Reyes and showed good composure to curl home into the corner.
Maxi Rodriguez missed a golden chance to make it 2-0 close to half-time and Villarreal responded by equalising three minutes after the interval with Fuster heading in from close range after some poor defending.
Substitute Llorente then popped up with the winner in stoppage time and Atletico jeered their losing team off after the final whistle.
"We have put an end to this poor run which had lasted 17 years and this is a great day for Mallorca because we broke this jinx at a stadium where we had never won before," said Manzano.
Depor could have moved level on points with third-placed Valencia but had to settle for a point that drops them to sixth place after substitute Pablo Alvarez cancelled out Kalu Uche's opener.
Elsewhere, Xerez stay rooted to the bottom of the table, six points from safety, after a 3-2 loss at Racing Santander.
Barcelona will be be top of the table for Christmas after a 1-0 derby win over Espanyol on Saturday in their final league match of 2009 and now head to the FIFA World Club Cup in Abu Dhabi looking for a sixth trophy inside a year.
"It wasn't a great game but the three points are what count," said Barca captain Carles Puyol. "Now we need to focus on the World Club Championship. It is an important tournament for us."
Real Madrid are five points behind Barca with a game in hand after beating Valencia 3-2 on Saturday but it came at a cost with key defender Pepe sustaining a cruciate knee injury that is expected to rule him out for the rest of the season.
"Pepe is irreplaceable," said Real general director Jorge Valdano. "There is no-one on the market like him but from tomorrow (Monday) we will discuss if we need to bring someone in."
Sevilla are also in action later on Sunday, hoping to move back above Valencia into third with a win at high-flying Sporting Gijon.
Source: AFP Global Edition