Los Blancos needed only to avoid defeat to give third-placed Barcelona no chance of producing a remarkable turnaround in the title race.
And they made no mistake against Barca's city rival on Sunday (AEST), Rodrygo doing the damage in the first half with a well-taken brace.
Marco Asensio made it 3-0 and Isco had a goal disallowed before Karim Benzema fittingly had the final say as Madrid claimed a 35th LaLiga title. It will now turn attention to trying to overturn a 4-3 deficit to Manchester City in the second leg of the EFA Champions League semi-final on Thursday (AEST).
Espanyol started brightly with plenty of energy but was fortunate not to go behind in the 13th minute when Mariano, playing as the central striker in place of the rested Benzema, hit the post with a header from point-blank range.
Mariano headed wide from Luka Modric's pass nine minutes later before the deadlock was broken by Rodrygo, who received Marcelo's cutback and stroked a side-footed effort into the bottom-right corner.
Ten minutes later, Rodrygo doubled their advantage, wrong-footing Diego Lopez with a clever finish after Espanyol lost possession deep in its own half.
Asensio effectively made sure of the points and the title 10 minutes into the second half, when he confidently finished off a rapid counter-attack led by Eduardo Camavinga.
Substitutes Benzema and Isco combined for what looked a fine fourth goal, only for the video assistant referee (VAR) to intervene with Lopez's vision apparently impeded by an offside player.
It mattered not as Madrid regained the title it lost to Atletico Madrid last season, Benzema's 81st-minute effort too strong for Lopez to put the icing on the cake.