The Maryland Senate narrowly ended a filibuster battle over stem cell research Wednesday, after hours of back-room negotiations produced a compromise that allowed both sides to claim victory.

Supporters of the bill broke the Republican-led filibuster when the Senate voted 29-18 to limit debate on the bill, which had gone on for about 5 hours.

They key move came when Senator Roy P. Dyson, D-St. Mary’s, changed his vote and joined other Democrats in opposing the filibuster. In two earlier attempts that ended in 28-19 votes, Dyson had voted against ending debate, giving the bill’s opponents the one vote they needed.

After the Senate voted to limit debate, Dyson introduced a compromise amendment to remove language that gave priority to embryonic stem cell research, an area of research opposed by people who believe that destroying a human embryo is tantamount to murder. With support from the bill’s primary sponsor, Senator Paula C. Hollinger, D-Baltimore County, Dyson’s amendment passed by a vote of 18-15.

“We were trying to work out a compromise on this all day,” Dyson said in an interview afterwards. “It took a lot of work.”

He said removing the focus on embryonic research was what ended the stalemate.

“That was the key,” he said. “It was the crux of the whole controversy.”

He said the compromise allowed adult stem cells and embryonic stem cells to compete for funding on a level playing field.

Senator Andrew P. Harris, D-Baltimore County, who led the filibuster, said opponents were not entirely unhappy with the outcome. “I don’t know what’s left of it,” Harris said of the amended measure. He noted that the specific funding figure of $25 million had been removed from the original bill, as had the priority for embryonic stem cell research.

Hollinger, for her part, described passage of her bill as a victory, “but I don’t know that there are losers here.”

A final vote on the bill could come as early as Thursday, and the bill’s supporters predict it will pass. It then must go to the House of Delegates, where it is expected to pass easily.

Throughout the day, opponents of the legislation spoke slowly and at length on the Senate floor, at times reading long passages from books, magazines and scientific journals.

Their criticisms of the bill focused on what they said were its economic and ethical failings.

Harris argued that state money would be better spent on adult stem cell research that was close to producing results.

“When you’re talking about embryonic research, you’re talking about way in the future,” he said on the Senate floor.

Hollinger fielded many criticisms from Harris and other opponents, arguing that Maryland needed to fund embryonic stem cell research because President Bush put federal funding restrictions on it in 2001. She said embryonic research held promise for curing a variety of diseases, including diabetes and Parkinson’s.

Hollinger and other supporters of the bill also fended off several attempts by the opponents to introduce further amen