Former Alaska governor Sarah Palin, left, and Sen. Jim DeMint (R-S.C.), right, stand with GOP Senate candidate Ted Cruz and his wife, Heidi, at a July 27 rally in The Woodlands, Tex. (Johnny Hanson/AP)

For much of the past year, things looked bad for the tea party. Polls showed little new interest from voters, and its favorite presidential contenders flopped in the face of Mitt Romney, who was denounced within the movement. But the final days of the Republican Senate runoff in Texas suggest that the tea party may be reshaping itself into a political operation with long-term viability.

On Tuesday, GOP voters will choose between former state solicitor general Ted Cruz, who has benefited from intense tea party support, and Lt. Gov. David Dewhurst, an establishment Republican and protege of Gov. Rick Perry. Dewhurst finished first in the primary in May but did not win a majority, forcing the runoff. According to recent polling, Cruz may be in the lead.

“As disappointing as it was when the nomination went to Mitt Romney, we all knew we had to work from the bottom up,” said Konni Burton, a leader of the NE Tarrant Tea Party, in the suburbs of Fort Worth. She and other activists criticize Dewhurst as too conciliatory toward Democrats in the Texas Legislature and generally too moderate in his politics.

Burton’s laundry room is one of dozens of local distribution points set up by tea party groups to send out literature promoting Cruz. Over the past few days, she and hundreds of other tea party supporters phoned tens of thousands of voters, knocked on doors and waved signs on street corners across the state.

“Boots-on-the-ground stuff,” Burton said. “It makes me laugh when people say the tea party was dead.”

Cruz also got a boost from last-minute visits to Texas by major tea party figures, including former Alaska governor Sarah Palin and Republican Sens. Jim DeMint (S.C.) and Rand Paul (Ky.).

Regardless of how the Texas vote turns out, it’s clear that a transformation is occurring and that it could have an effect on the presidential election in November — and the longer-term balance of power in the Republican Party.

The tea party is no longer the rising tsunami it appeared to be in 2010. Largely gone are the disorderly rallies, colonial-era costumes and fixations on fringe issues, such as the provenance of the president’s birth certificate. Instead, the movement has retooled into a loosely organized network of field operations that, as in Texas, pushes Republicans toward more strident conservative positions and candidates, while supplying ground troops across the country for candidates and big-money conservative groups, such as the Club for Growth and Americans for Prosperity.

Challenges to the establishment

This year, tea party efforts have helped oust long-standing centrist Sen. Richard G. Lugar (R-Ind.) and have forced establishment GOP incumbents or candidates into primary runoffs in Utah and Texas. In Utah, Sen. Orrin G. Hatch easily held off the tea party challenger in one of those runoffs — partly by tacking hard to the right.

“The ability of the tea party to really influence the quality and makeup of a potential Republican majority in the Senate is going to be a really big story,” said Matt Kibbe, president of FreedomWorks, a Washington-based tea party support group chaired by former House majority leader Richard K. Armey (R-Tex.).

FreedomWorks says that almost 190,000 activists have joined its “FreedomConnector” online network and that it expects fundraising in 2012 to exceed the approximately $21 million it collected last year. Through the end of May, tea-party-associated political action committees had raised almost $18 million.

Tea Party Patriots, an organization that says it is affiliated with more than 3,500 local tea party groups, reported raising $12 million in donations in 2011 and says it is on track to match or surpass that number this year. Across the country, once-fractious tea party groups are working in concert with state and national Republican parties on key campaigns, especially in critical swing states.

Teaming up in Ohio

In pivotal Ohio, tea party organizers who not long ago opposed the presumptive Republican nominee recently supplied hundreds of volunteers for a Romney campaign operation dubbed the “Buckeye Blitz.” In June, the volunteers visited more than 100,000 households identified by the GOP as undecided or independent voters, according to David Zupan, a tea party activist in Avon Lake, a suburb of Cleveland. In a big push this month, a mix of tea party and other Romney volunteers visited at least 40,000 homes in all 88 Ohio counties, according to Scott Jennings, Romney’s state director in Ohio.

Tea party activists in the state are most focused on electing Republican Senate candidate Josh Mandel, the state treasurer, who was the star attraction at a meeting of more than 1,000 tea party activists in Columbus in late June.

“We had some success as a movement, but we realized we just didn’t have the knowledge that we needed. How many signatures do you need? Campaign law? How do you qualify?” said Tom Zawistowski, president of Ohio’s Portage County Tea Party. “We went from a protest movement to an activist movement with a structure.”

Criticism of a new alliance

The increased collaboration hasn’t been successful everywhere. Some tea party leaders have been harshly critical, saying the movement is becoming too overtly aligned with the Republican Party.

In some states, tea party efforts have also had unintended consequences. The tea party campaign in Indiana, which included more than $600,000 spent by FreedomWorks, visits by volunteers to 125,000 homes and more than 400,000 phone calls, was key to the resounding primary defeat of Lugar, the longtime senator. But polls now suggest that the once solidly Republican seat is a tossup in the November face-off between state Treasurer Richard Mourdock, the tea party candidate, and Rep. Joe Donnelly, a central Indiana Democrat. That could lead to a new Democratic senator in a seat that was long unquestionably Republican.

The tea party also has a fundamental quandary in the presidential campaign: its previously ferocious opposition to Romney. Deep into the primary season, tea party groups routinely blasted him as unacceptable. Last fall, a promotional Web page for a FreedomWorks anti-Romney rally in New Hampshire called the candidate an “establishment hack” who “represents everything the tea party stands against.”

FreedomWorks says that it hasn’t taken back anything but that any alternative to President Obama is preferable.

“The critique stands,” Brendan Steinhauser, the group’s director of state and federal campaigns, said in an interview. “But Mitt Romney will be a better candidate because of the wringer we’ve put him through.”