Yamal scored in the 53rd minute on Thursday when the teenage phenom slid past two defenders along the edge of the area before he whipped one of his now trademark left-footed curlers into the corner of the net.
It was a fitting culmination to Yamal's season. The 17-year-old excelled for Barcelona with his goals, dribbling and playmaking as he confirmed his status as the next big star of global soccer.
Fermín López scored in stoppage time after Espanyol were reduced to 10 men in the 80th when Leandro Cabrera saw a direct red for hitting Yamal in the stomach while disputing a ball.
Barcelona won the title with two rounds remaining. They completed a domestic double with the Copa del Rey title and reached the Champions League semi-finals in a fantastic first season for coach Hansi Flick.
Flick's team virtually ended Madrid's title defence when they beat them 4-3 on Sunday, making it four of four clasico victories across all competitions this season.
Madrid's victory over Mallorca on Wednesday impeded Barcelona from winning the title without playing. But the Catalan club needed just two points from their final three games of the season.
Barcelona players danced briefly on the field to celebrate while they were sprayed by sprinklers.
Espanyol outplayed Barca in the first half. But Urko González shot wide on a counterattack early on and Javi Puado couldn't beat Wojciech Szczesny in a one-on-one opportunity.
But Yamal's great shot put Barcelona in control. Espanyol goalkeeper Joan García, who is linked to a move to a big club this summer, including Barcelona, couldn't reach the perfectly placed shot.
Espanyol were looking for a good result from the derby as they hope to stay out of the relegation fight. Espanyol remain in 16th place and five points from the drop zone.