PITTSBURGH — Dusty Baker couldn’t help but smile as he watched his players pour champagne and beer on each other.

The Washington Nationals clinched their third National League East title in five years on Saturday night. They beat the Pittsburgh Pirates 6-1 and watched on TV in the clubhouse as the New York Mets were eliminated from the division race 20 minutes later with a 10-8 loss to the Philadelphia Phillies.

Then the party started.

“Let the animals run wild, and they are certainly running wild tonight,” said Baker, the Nationals’ first-year manager. “I love it. Look at them. These are the wildest I’ve ever seen.”

The Nationals were seemingly not only celebrating a division title but releasing pent-up frustration that remained from a disappointing 2015 season.

The Nationals were considered by many to be World Series favorites after signing right-hander Max Scherzer to a seven-year, $210-million contract in free agency the previous winter. They not only missed the playoffs, but then-closer Jonathan Papelbon choked right fielder Bryce Harper during a late-season dugout argument.

“We were all (upset),” Scherzer said. “Because we had a team we knew was capable of winning and winning in the postseason, winning in October. I believe we have that team again.”

Manager Matt Williams was fired at the end of last season and replaced by Baker, who had 20 years of experience managing the San Francisco Giants, Chicago Cubs and Cincinnati Reds.

Out of the game for two years after being fired by the Reds following the 2013 season, the 67-year-old Baker has been questioned at times for his handling of the pitching staff. But he has provided a steady hand.

“This is the first step in a four-step process,” Baker said “We want to do this three more times, then hopefully be the world champions. We’re not done yet.”

The Nationals have never reached the World Series during the franchise’s 47-year history that began in 1969 as the Montreal Expos before the team relocated to Washington in 2005.

Except for a four-day stretch in May, the Nationals were on top of the division all season. They took the lead for good May 13 then built a double-digit advantage in September despite a down year from Harper, who is hitting just .243 with 24 home runs in 143 games after winning the NL MVP a year ago when he batted .330 with an NL-leading 42 homers.

However, second baseman Daniel Murphy, who helped the Mets reach the World Series last year, has made a major impact after being signed as a free agent in the offseason. Though sidelined by a strained glut muscle in recent days, he is hitting .347 with a league-best 47 doubles and 25 home runs in 141 games.

Rookie Trea Turner also has made a major impact since becoming a lineup fixture in August, hitting .336 with 12 home runs and 27 stolen bases in 65 games while converting from shortstop to center fielder.

Scherzer has been stellar as the ace of the pitching staff. He is 18-7 with a 2.82 ERA, a league-leading 267 strikeouts and a record-tying 20-strikeout game in May.

He has helped the Nationals work with a rotation that has been weakened by injuries to Stephen Strasburg and Joe Ross along with the inconsistent performance of left-hander Gio Gonzalez.

The Nationals also had to trade for Pittsburgh Pirates closer Mark Melancon on July 30 after Papelbon faltered and was eventually released. Melancon converted his first 12 save opportunities before blowing one Friday night at Pittsburgh.

“It was more of a team effort,” Nationals right fielder Jayson Werth said. “It was everybody. Everybody contributed. You can look at everybody on the team and say that guy’s the reason why we’re here.

“That’s what good teams are about. We’ve got our potential MVP candidate. We’ve got our potential Cy Young award winner. But everybody’s contributed.”