The loss ended an unbeaten run of 42 consecutive home games for Barcelona in the league dating back to a 2-1 defeat to Alaves on September 10, 2016. He was recently dropped from the Barcelona squad for the game against Real Betis after failing to report for training.
After five matches out injured, Messi returned but his two goals, one from the penalty spot and another deep into injury-time, proved little more than consolations.
The Spanish press weren't entirely sympathetic in the aftermath, with Mundo Deportivo branding the result a "lesson" for Barcelona.
In spite of Sunday's defeat, Barca still lead the standings and are one point clear of Atletico Madrid, Alaves and Sevilla.
Guardiola in hot water over Manchester derby ref comments
While everyone else in the Premier League has a fatal flaw or is struggling to play their best, City continue to wreck every team they play.
Alaves beat Huesca 2-1 earlier on Sunday, while Sevilla won by the same scoreline at home to Espanyol, Wissam Ben Yedder prodding in an 89th-minute victor. We want the best from every player in our team. "If I was in a position where this game was going to take the record off Peter Shilton, I would never have played in the game", he said.
On his future, Solari said: "We'll see".
"We'll find out tomorrow if I decide he can play 90 minutes or not".
William Carvalho produced a brilliant through-ball to release Junior down the left and he cut in on to his right foot in front of Sergi Roberto before beating Ter Stegen at the near post.
Thousand Oaks shooter’s high school coach says he sexually assaulted her
The city is consistently ranked near the top of the lists of safest places in California . The gunman, 28-year-old Ian David Long , was an ex-Marine who had served in Afghanistan .
The visitors were, however, to net on two more occasions before Messi - after seeing Arturo Vidal find the target and Ivan Rakitic shown a red card - grabbed his second in stoppage-time.
Junior's low cross was met at the back post by Cristian Tello, who picked out Joaquin to slide past Ter Stegen from 10 yards for his second league goal of the campaign.
The only blot for Solari was a spate of injuries which saw Casemiro, Sergio Reguilon and Nacho all forced off. Gareth Bale also took a knock to his left ankle in the first half but was able to continue.
"We paid dearly for not playing well in the first half".
Thousands flee as three California blazes leave trails of destruction
An earlier report said that five people were fatally killed in the fire while they were in a van trying to outrun the fire. Three fires across northern and southern California have scorched thousands of acres fanned by strong Santa Ana winds.
Dembele was also reportedly late for a team meeting before a Champions League game earlier this season and sources say Barca's concerns over the forward's punctuality and diet date back to when he was sidelined for four months last season.