AUSTIN - All the rancorous debate ended, the final gavel fell and Republican Tom Craddick remained speaker of the Texas House as lawmakers finished a tumultuous five-month legislative session.

The House and Senate capped their 140-day session Monday with a last-ditch round of arguing over water and border security. Sprinkled in were moments of frivolity as lawmakers wrapped up their work and headed home.

"Y'all have been a big barrel of fun the whole damn time," Rep. Anna Mowery, a Fort Worth Republican who doesn't plan to seek re-election, told fellow legislators.

The session's final weekend provided plenty of drama for all watching at the Capitol and on television and via the Internet.

Opponents from both political parties tried repeatedly to oust Craddick from power, with no success. Craddick refused to allow the opposition to even bring up a motion for a vote to "vacate the chair."

The longest-serving House member and the first Republican speaker since Reconstruction, Craddick took over in 2003 after the GOP won a majority of House seats.

Democrats and Republicans alike complain that Craddick has ruled with an iron fist. They say his win-at-all-cost style often forces them to vote against the interests of their own districts.

Frustrated by their failed attempts to overthrow Craddick, dozens of angry House members stormed out of the chamber in protest early Monday.

"This man is sitting here violating every rule of the House, every rule of parliamentary procedure to keep himself in office, and it's wrong," said Rep. Pat Haggerty, R-El Paso.

A prepared statement from Craddick's office chided those it said were trying to divert the House from important matters and drag lawmakers into a speaker's race. Several House members had filed paperwork to become speaker should Craddick leave the post.

House members who'd walked out earlier returned by Monday afternoon to pass more bills: mandatory high school steroid testing; daily physical exercise for middle school students; and strengthened protections for foster children.

Lawmakers approved the one bill they are legally required to pass - the state budget.

Despite some 11th hour fights and threats in the Senate to filibuster the budget bill, or talk it to death, the House and Senate signed off late Sunday night and early Monday on a compromise $153 billion two-year spending plan, the state's largest ever.

Republican Lt. Gov. David Dewhurst, who presides over the Senate, said he's proud of legislation passed this spring and lamented that the House fighting might distract from it.

"I hope that the people of Texas realize that and don't get confused by some of the back-and-forth that was going on in the House," Dewhurst said.

The session started with conflict over Gov. Rick Perry's executive order requiring the vaccine against the human papillomavirus for sixth-grade girls. The vaccine protects against strains of the sexually transmitted virus that cause most cases of cervical cancer.

Some said Perry's order infringed on parental decisions. Others thought it might encourage premarital sex. And some simply said the Legislature should make that kind of state policy. Lawmakers passed a bill blocking his order, and Perry let it become law without his signature.

Perry firmly opposed a transportation bill that contained a two-year moratorium on toll road projects, but it was because of other provisions in the measure that he said would hinder the state's ability to build highways. By threatening to call a special session, he forced lawmakers to redo the proposal. They did, with a slightly more limited toll-road moratorium.

Associated Press Writers April Castro, Liz Austin Peterson and Jim Vertuno contributed to this report.