The Argentina captain had the opportunity to reach the landmark in the first half at Mendizorroza from the penalty spot, but saw a weak effort stopped by Pacheco.
But the goalkeeper was powerless to stop him making amends just before the hour mark with a powerful finish to put Barcelona 1-0 ahead.
Messi's goal got him off the mark this Liga season after going scoreless in the opener against Betis, and took him to the unprecedented landmark of 350, all of which have been scored with Barca.
But he did not stop there, adding another shortly afterwards to double his club's advantage.
Already the highest scorer in the history of the Spanish top flight, Messi thus extends by one his advantage over Real Madrid star Cristiano Ronaldo.
The Portuguese hitman has netted 285 times in just 265 Liga games, compared to Messi's 351 in 384.
Ronaldo, however, will have to wait for his next chance to add to his tally as he serves the last three games of his five-match domestic ban for pushing a referee.
The pair are the only two active stars to make the top 10 of historic scorers, with Athletic legend of the 1940s Telmo Zarra completing the podium with 251 strikes.