Without Messi, Luis Suárez and Ousmane Dembele because of injuries, the Catalan club let victory escape after conceding an 81st-minute equalizer from a penalty kick awarded because of a handball by defender Gerard Piqué.
Messi, nursing a calf injury, is yet to play in the league this season, while Suárez and Dembele appeared only in the first match, when the two-time defending champion lost 1-0 at Athletic Bilbao for its first opening defeat in a decade.
"We were terrible, they got the lead and we couldn't get near their area," Barcelona coach Ernesto Valverde said. "We played better in the second half and controlled the game, but we can't allow the game to get away from us like that."
Midfielder Roberto Torres converted the late penalty for Osasuna. He had also found the net with a neat volley less than 10 minutes into the game to put the hosts ahead in Pamplona. Barcelona rallied with goals early in the second half by substitutes Ansu Fati and Arthur.
Fati, a 16-year-old from Guinea-Bissau, scored his first goal with the senior team with a 51st-minute header. The speedy youngster had made his first-team debut in the 5-2 win over Real Betis at Camp Nou Stadium last weekend.
Arthur got on the board with a well-placed shot into the far corner after cutting back to avoid two defenders in the 64th. Carles Pérez, a 21-year-old starting his second straight match due to Barcelona's injuries, had a great chance to give his team the lead in the 88th but lost control of the ball with only the goalkeeper to beat.
Antoine Griezmann, who scored twice against Betis, had a lackluster performance on Saturday. "We are upset because we did the hard part, which was to come from behind to take the lead," Sergi Roberto said. "There is still a lot of league left. This should come as a message that we can't lose our focus."
Osasuna remains unbeaten on its return to the first division after opening with a victory and two draws. It hasn't lost in 27 straight home games at El Sadar Stadium. "The team played well and in the end we were awarded the penalty," Torres said. "It was a fair result."
Before the match there was a minute's silence in tribute to 9-year-old Xana, the daughter of former Spain and Barcelona coach Luis Enrique. She died on Thursday from a type of bone cancer. The silence will be repeated for all games in Spain this weekend.
OTHER RESULTS Real Betis rebounded from two consecutive losses by coming from behind to defeat Leganés 2-1 at home with second-half goals by Lorenzo "Loren" Morón and Nabil Fekir. Getafe drew 1-1 with Alavés at home, while Levante defeated visiting Valladolid 2-0 with late goals by Sergio León and José Luis Morales.
On Sunday, Atlético Madrid hosts Eibar and Real Madrid plays at Villarreal.
More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports
Tales Azzoni on Twitter: http://twitter.com/tazzoni