PROVIDENCE, R.I. — Liberal-leaning Democrats who sought to upend Rhode Island’s political leadership in Tuesday’s state primary have cost several longtime Democratic lawmakers their seats in the General Assembly.

The Rhode Island Progressive Democrats, which pushed several of the challengers to run, called the primary election a “massive blow to the conservative machine within Rhode Island.”

State Democratic Party Chairman Joseph McNamara took a more measured approach, noting that losing incumbents were a minority in the 113-member Legislature.

He said the party has a “big tent” and will support all the Democratic primary winners 100 percent, even though it supported the incumbents leading up to the election.

Lawmakers who lost their seats included Sen. William Walaska and Rep. Eileen Naughton, both of Warwick, Rep. Jan Malik of Warren and Sen. Juan Pichardo of Providence.

House Majority Leader John DeSimone, one of the most powerful members of the House, and Rep. Thomas Palangio were also behind in tight races to keep their seats representing the north end of Providence. DeSimone asked for a recount Wednesday after preliminary results showed him losing by 17 votes to Providence teacher Marcia Ranglin-Vassell.

Palangio is also seeking a recount. He was 21 votes behind activist and waitress Moira Walsh.

Walaska was defeated by Jeanine Calkin, who had worked on the Bernie Sanders presidential campaign. Malik lost to Jason Knight, a Barrington attorney who portrayed Malik as too conservative on gun rights. Warwick City Councilwoman Camille Vella-Wilkinson defeated Naughton. Providence city code inspector Ana Quezada defeated Pichardo in a race that centered more on political effectiveness than ideological differences. Walaska and Naughton were first elected in 1992, Malik in 1996, Pichardo in 2002, as the state’s first Latino lawmaker.

Republicans had few competitive primaries Tuesday. An exception was in Cranston, where GOP National Committeeman Steve Frias defeated an opponent for the chance to compete against Democratic House Speaker Nicholas Mattiello in November’s general election.

For some Democratic lawmakers, the primary was the most competitive election in years.

Some newcomers who challenged incumbents from the left said they were motivated to run after campaigning for Sanders, who beat Hillary Clinton by nearly 12 percentage points in the state’s April primary.