Aaron Judge of the Yankees celebrates his sixth-inning home run against the...

Aaron Judge of the Yankees celebrates his sixth-inning home run against the Toronto Blue Jays in the second game of a doubleheader at Yankee Stadium on Sunday. Credit: Jim McIsaac

The day began with the announcement that Devin Williams had been demoted from the closer role.

It ended with a tidy appearance by Luke Weaver to close out a by-the-numbers win.

In between, there was a lot of muscle-flexing by the Yankees, who swept a doubleheader against the Blue Jays on Sunday at Yankee Stadium.

“It’s not an easy thing to do,” Aaron Boone said after the Yankees’ 11-2 and 5-1 wins. “Great way to finish off a series.”

The Yankees (17-11) had 12 hits in Game 1, including a home run by Anthony Volpe and five doubles, and nine hits in Game 2, including homers by Trent Grisham (his seventh), Aaron Judge (his eighth) and J.C. Escarra (the first of his major-league career).

Max Fried (5-0, 1.43 ERA) allowed one run, six hits and two walks in six innings in Game 1.

Fried, who entered the game averaging 97 pitches in his first five starts, threw 27 in the first inning and allowed an RBI groundout by Vladimir Guerrero.

“He was great,” Austin Wells said. “Grinded through the first inning; kind of missed some spots here and there in the first, and then after that, it was five pretty solid innings.”

Blue Jays starter Kevin Gausman allowed six runs, three hits and five walks in 2 2⁄3 innings. Wells capped a six-run third with a three-run double off the wall of the Yankees’ bullpen on Gausman’s 53rd and final pitch of the inning — yes, you read that correctly — to give the Yankees a 6-1 lead.

Earlier in the inning, after Oswaldo Cabrera and Ben Rice walked and Judge singled to load the bases with one out, Cody Bellinger’s sacrifice fly tied the score at 1-1. Consecutive walks to Paul Goldschmidt, Jazz Chisholm Jr. and Volpe made it 3-1.

“Momentum and confidence,” Wells said of the Yankees’ approach in the pivotal inning. “Guys were taking close pitches, taking really good swings.”

That trend continued in Game 2 as the Yankees used a three-run sixth to chase former Mets starter Chris Bassitt.

Judge led off the inning by drilling Bassitt’s first-pitch cutter 376 feet over the right-centerfield wall to break a 1-1 tie.

Four batters later, Jasson Dominguez’s two-out RBI double gave the Yankees a 3-1 lead and knocked out Bassitt.

Escarra greeted Brendon Little with an RBI single to stretch the lead to 4-1 and then hit a 415-foot homer off former Yankee Chad Green with two outs in the eighth. “It felt amazing,” he said. “Amazing.”

The Yankees took a 1-0 lead on Bassitt’s third pitch of the game on Grisham’s homer, but the Jays drew even with two outs in the third when Anthony Santander drove Clarke Schmidt’s 92-mph sinker 401 feet into the second deck in rightfield.

Schmidt went five innings, yielding one hit and four walks with six strikeouts. His ERA fell from 7.45 to 5.52. “Continuing to get better and continuing to improve,” he said.

Tim Hill (3-0), Mark Leiter Jr., Fernando Cruz and Weaver pitched the final four innings. Weaver, who Boone said will get the majority of the save opportunities now that Williams has been demoted into an undefined role, threw a 1-2-3 ninth.

“I prepare the same way,” Weaver said. “It’s about [being able] to get outs.”

As for Williams, who is 0-2 with an 11.25 ERA in his first season with the Yankees, Boone said: “For right now, it’s best for everyone that we pull him out of that role and just try and start building some good rhythm and confidence and momentum and fully expect him to be a central figure for us moving forward.”

When asked how Williams will be used, Boone said there is “no specific role” for him. “Just trying to get him in the best spots to be successful and stack those,” he said.

A downcast Williams, who did not pitch in either of the games, admitted to feeling disappointed but not surprised about the decision.

“I would like to be back on the mound as soon as I can,” he said. “My biggest concern right now is to start putting up zeroes.”

Notes & quotes: Luis Gil (right lat strain) began his throwing program before the game. “Excited,” Boone said. “I thought it was going to be Monday.” . . . Before Game 1, the Yankees recalled righthander Yerry de los Santos from Triple-A Scranton/Wilkes-Barre as the 27th man for the doubleheader. He allowed three hits in two scoreless innings in Game 1 and then was sent back to Scranton.