Catcher Ivan Rodriguez spent the final two years — 2010 and 2011 — of his long major league career with the Nationals. (John McDonnell/THE WASHINGTON POST)

Jeff Bagwell, Tim Raines and Ivan Rodriguez were elected to the Baseball Hall of Fame on Wednesday, as a voting pool that has skewed younger, more analytically inclined and less concerned about performance-enhancing drugs ended the long waits of sabermetric darlings Bagwell and Raines and looked beyond the drug suspicions surrounding Rodriguez, while also moving closer to enshrining the two biggest names of baseball’s so-called steroids era.

Bagwell, a slugging first baseman for the Houston Astros, led all candidates with 381 votes (86.2 percent) out of a possible 442 cast by 10-year members of the Baseball Writers Association of America, and was in his seventh year on the ballot, while Raines, a speedy left fielder for the Montreal Expos, among other teams, got 380 votes (86 percent) in his 10th and final year. To gain election, a player must be named on at least 75 percent of ballots.

Rodriguez, meanwhile, became only the second catcher, after Johnny Bench, to be elected in his first year on the ballot. He also became the first Washington Nationals player in the Hall; although he spent the bulk of his career in Texas and Detroit, he spent the final two of his 21 seasons in the nation’s capital.

Bagwell, Raines and Rodriguez will be inducted in a ceremony in Cooperstown, N.Y., in July.

Tim Raines was arguably the second-greatest leadoff hitter in history, but had the misfortune of playing in the same era as the undisputed greatest, Rickey Henderson. (Ezra Shaw)

“I’ve had trouble sleeping for three days,” Rodriguez said. “It was hard for me. [But] just to be in Cooperstown right next to all those tremendous Hall of Famers already on that wall — I can’t wait until July.”

The trio was nearly a quintet, as closer Trevor Hoffman (327 votes, 74 percent) fell just five votes shy of election and slugging outfielder Vladimir Guerrero (317, 71.7 percent) fell just 15 shy. Cooperstown has not seen a five-player class enter the Hall since its inaugural one, in 1936.

Further down the ballot, this election was notable for the significant gains made by Roger Clemens and Barry Bonds — arguably the greatest pitcher and greatest hitter in history, respectively, but also the two most visible figures from the sport’s steroid era of the late-1990s-to-mid-2000s — in their fifth appearances on the ballot.

Clemens and Bonds picked up 40 and 43 extra votes over last year, respectively, and now, at 54.1 percent and 53.8 percent, appear on trajectories that have historically led to eventual election to Cooperstown.

The candidacies of Bonds and Clemens, which once appeared as doomed as those of voter-rejected contemporaries Mark McGwire and Rafael Palmeiro, were undoubtedly aided by the election in December (by a separate committee tasked with considering non-playing personnel) of former commissioner Bud Selig, who ran the game during the steroids era. Many voters cited Selig’s election in choosing to switch to “yes” votes for Bonds and Clemens; neither player had cracked the 40 percent mark until last year.

Raines, 57, was arguably the second-greatest leadoff hitter in history but had the misfortune of playing in the same era as the undisputed greatest, Rickey Henderson. In his first year on the Hall of Fame ballot, 2008, Raines was named on just 24.3 percent of ballots — among players voted in by the BBWAA, only Bert Blyleven, a 2011 inductee, started with a lower percentage in his first year on the ballot — and he was still getting less than half as recently as 2012.

Jeff Bagwell, a slugging first baseman for the Houston Astros, led all candidates with 381 votes (86.2 percent) out of a possible 442 cast by 10-year members of the Baseball Writers Association of America. (Karen Warren/AP)

Likewise, Bagwell, 48, was overshadowed by contemporaries such as McGwire and Frank Thomas, first basemen who amassed more home runs during an era in which the home run was king. Bagwell first appeared on the ballot in 2011 and earned just 41.7 percent support.

With Raines falling shy of 3,000 hits (he had 2,605) and Bagwell not reaching 500 homers (he hit 449) — unofficial markers that have all but guaranteed a place in Cooperstown — they were easy to overlook by traditional statistical measures. Bagwell was also hurt by suspicions, never proved, that he used steroids, as well as his admission that he had used androstenedione, a steroid precursor, before it was banned by MLB.

But with the rise in influence of advanced statistical metrics within the game — as well as a purge of older, inactive voters by the Hall of Fame 18 months ago — the cases of Bagwell and Raines began to gain momentum. Both rate favorably among Hall of Fame predecessors at their positions in new-school stats such as Wins Above Replacement (WAR) and adjusted on-base-plus-slugging (OPS+).

“Back in the day, [voters] looked at the 500 home runs, the 300 wins and the 3,000 hits,” Raines said. “A lot of times, if you didn’t reach those criteria, it’s hard for anyone to look at you as a Hall of Famer. . . . A lot of people didn’t really know what Tim Raines was as a player. But [advanced stats] have opened voters’ minds. There were a lot of things I did that other guys who are already in the Hall of Fame didn’t do. It made them look a lot closer and a lot deeper, and the more they looked, it turned out better for me.”

Rodriguez, 45, is widely considered the best defensive catcher in history and was named the American League MVP in 1999. He spent the 2010 and 2011 seasons with the Nationals, retiring as baseball’s all-time leader in games caught. By WAR, he rates as the third-best catcher in MLB history, behind only Hall of Famers Bench and Gary Carter. Though he was never known to have failed a drug test and was not named in the pivotal Mitchell report on PED use in baseball, he was accused by former teammate Jose Canseco of steroid use and was dogged by suspicions throughout his career — which he has denied.

Asked Wednesday which attributes took him the furthest in his career, Rodriguez said, “I love the game of baseball, and I took a lot of pride every day, and I was a winner.”

Among the other players who made large gains in this year’s voting — portending possible election down the road — were longtime Seattle Mariners designated hitter Edgar Martinez (58.6 percent) and former Baltimore Orioles and New York Yankees ace Mike Mussina (51.8 percent). Pitcher Curt Schilling (45.0 percent, down from 52.3 percent last year) was among those suffering the biggest drops, while Yankees catcher Jorge Posada (3.8 percent) was the best first-time candidate who fell off the ballot after failing to get at least 5 percent.

Next year’s ballot will be headed by first-time candidates Chipper Jones and Jim Thome , while Yankees superstars Mariano Rivera and Derek Jeter appear for the first time in 2019 and 2020, respectively .