The Argentine did not start the game but his introduction changed the completion of the clash.
The win makes Messi the first player in Barcelona to win 10 league titles.
Speaking after the victory, Valverde said: “Messi was always ready to come on and I always knew he was going to play but we also have a game on Wednesday.
“He has to stay active and he scores goals everywhere he goes and he has won us this title.
“It is very difficult to win this title, especially with this margin. We have done it two years in a row and it’s fantastic to see the fans celebrate the title like this at home.
“Now we want to go and celebrate it.”
Valverde added: “They had a few chances but it was incredible when they hit the post.
“We couldn’t kill the game off and they started to believe while we get more nervous but luckily we were able to see out the win.”