Spanish sources had initially claimed that Messi would sit the match out because of flu, but the diminutive Argentine started the match on the bench.
Messi came on in the 59th minute and helped Barca cruise to an emphatic win with two goals, and Guardiola noted that it was the player himself who gave the green light to feature in the match.
"Messi was feeling unwell this morning, he had stomach ache and some fever, so we sent him home," Guardiola told reporters at a post-match news conference.
"I told him to come and watch the match and if he felt fine, he would play. He called me three hours before the game and told me he wanted to play, so I put him on the bench.
"The tie was not over, we were having a good match and I decided to let him play 30 minutes and you know the rest.
"After a break it is never easy to play, but we got off to a great start. We told Messi to warm up in order to warm the crowd up. We had a superb match."
The second leg at Osasuna will be held on January 12.
How do you stay up to date with football when on the move? With http://m.goal.com – your best source for mobile coverage of the beautiful game.