As his players mashed together in the middle of the clubhouse, joyously spraying each other with bottles of expensive champagne and cans of cheap beer on Friday night, Red Sox manager John Farrell watched from the doorway of this office with a smile.

Team owner John Henry, after pausing to snap a few photos of the scene with his smartphone, found Farrell and shook his hand.

It’s a sentiment widely shared in New England and beyond by those who have followed the roller coaster fortunes of the Red Sox the last few years. Farrell and his bearded band of brothers have made it fun again.

The Sox completed their improbable last-to-first journey, clinching the American League East with a 6-3 victory against the Toronto Blue Jays. It touched off a raucous party on the Fenway Park lawn that lasted nearly to midnight.

“This is different because in years past it was almost expected,” said Jon Lester, who pitched seven strong innings for his 100th career win. “To go through some of the things we’ve gone through the past three years, the injuries and nonsense and everything, to finally be back at this point is very, very rewarding.

“We’re going to sit back and enjoy this and really let it soak in.”

Lester allowed one run and struck out eight. Koji Uehara then got the final five outs, the final one on a strikeout of Brett Lawrie that started the party.

Uehara at one point jumped on top of the dugout and high-fived dozens of fans from the sellout crowd of 37,215.

“Get on the bandwagon, there’s plenty of room,” said outfielder Jonny Gomes, who traded his cap for a combat helmet. “We ain’t done.”

The 94-61 Red Sox have won the AL East seven times since baseball started divisional play in 1969. But this marks the first time in franchise history the team went from last place to first.

The Sox were 69-93 last season, finishing a whopping 26 games behind the Yankees. The team was so dispiritingly bad that disgruntled stars Josh Beckett, Carl Crawford, and Adrian Gonzalez were traded to the Los Angeles Dodgers in August to free the franchise of their high salaries.

Within hours of the last pitch, manager Bobby Valentine was fired after only year on the job. Farrell was then hired as manager and the roster was remade. The Sox expressed a simple hope they would be competitive. Instead they have been baseball’s best team, staying in first place for 148 days.

“We were confident that we had a good team and we knew this was a division that was up for grabs. We were able to separate and create some space between ourselves and the rest of the teams in the division,” Farrell said.

“That’s a testament to the abilities, the talent, and more than anything the work ethic of this group.”

Lester embodied that on Friday. He was at 109 pitches after six innings but told Farrell he was going back out for the seventh to protect a 2-1 lead.

“I felt like I had to go seven. I had to try,” Lester said. “I know we have a little bit of a break coming up. That was the time to pull a little bit of a card on him and it worked.”

Lester held the Jays down, returning the side and getting to 123 pitches, one off his high for the season. Lester (15-8) is 7-2 with a 2.29 earned run average in 12 starts since the All-Star break and sure to start Game 1 of the Division Series on Oct. 4.

When the Sox scored three runs in the bottom of the seventh, two on a single by Mike Carp, the lead looked secure. But Uehara was needed in the eighth inning after Junichi Tazawa allowed two runs.

Uehara allowed two hits but never cracked. The save was his 20th.

“This group of guys, we bonded so well,” catcher Jarrod Saltalamacchia said. “We try to go out there and have fun. But we never lose sight of what we need to do.”

There was some irony to Esmil Rogers starting for the Blue Jays and taking the loss.

Toronto traded Mike Aviles to Cleveland to obtain Rogers. Aviles was the player the Blue Jays obtained from Boston as compensation for Farrell breaking his contract to become manager of the Red Sox.

Rogers (5-8) lasted only 2⅓ innings, giving up two runs on three hits and five walks.

Pedroia started the bottom of the first inning with a double off the wall in left field to extend his hitting streak to 10 games. Pedroia then tagged up and went to third when Daniel Nava flied to center field.

With David Ortiz at the plate, Pedroia scored on a wild pitch.

Poor control cost Rogers again in the third inning. Nava doubled to left field with one out. Toronto then intentionally walked Ortiz with first base open.

But Rogers walked Mike Napoli and Carp to force in a run. After 60 pitches (a scant 29 for strikes) he was lifted.

The Red Sox opened the game up in the seventh inning. Singles by Jackie Bradley Jr., Pedroia, Nava, and Ortiz off Neil Wagner extended the lead to 3-1. Carp’s two-run single provided some padding.

The Sox have seven more games to gain the top seed in the American League. For now, they’ll enjoy the moment.

“It’s hard to win the American League East. This is an accomplishment,” Henry said. “I haven’t felt like this since we won the 2007 World Series.

“I wouldn’t want to have to play us. Our pitching is really strong. In a short series, anything can happen. But this a tough team and I’m so proud of them.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.