“Seven years of evidence and experience ultimately demonstrated that Indiana did need a right to work law to capture jobs for which, despite our highly rated business climate, we are not currently being considered,” Mr. Daniels said in a statement that his office released after he signed the bill. For a month, the issue had loomed over Indianapolis, and hundreds of union members crowded, day after day, into the Statehouse halls. Democrats, who hold minorities in both legislative chambers, had refused at times to go to the House floor, hoping to block a vote on the matter, which they argued would weaken unions and lower pay and wages for workers at private-sector companies. Even on Wednesday, when it was clear that passage was certain, tensions were high. As senators spoke on both sides, protesters in the halls chanted loudly and a few people inside the chamber called out objections during the proceedings. In the end, senators voted 28 to 22 in favor of the measure, which was approved last week by the House.

Republican leaders defended the unusually swift passage of the measure, noting what they described as “overt threats” by union members and others about intentions to raise the right to work issue during the Super Bowl.

“We sized up early on that passage prior to the Super Bowl would be appropriate,” Brian Bosma, the speaker of the House, said Wednesday, adding that the law enforcement authorities were prepared for any efforts to disrupt the city’s first Super Bowl. “That would be extremely unfortunate,” he said, “and, I think, tremendously unpopular.”

For their part, union leaders said the Republicans had overblown the union’s intentions on the football game.

“They’re trying to make working men and women look like thugs, like we’re going to ruin an event,” said Jeff Harris, a spokesman for the Indiana A.F.L.-C.I.O., who added that their expectation for the Super Bowl was to have “a presence but an informational presence,” handing out leaflets on the issue.