WASHINGTON — Congress on Friday approved a $787 billion economic stimulus measure, meeting the crushing mid-February deadline that Democrats had set for adopting the centerpiece of President Obama’s early agenda but without quelling partisan divisions in Washington. Not a single House Republican voted for the bill.

The House vote was 246 to 183, with just 7 Democrats joining all 176 Republicans in opposition. In the Senate, the vote, 60 to 38, was similarly partisan. Only 3 centrist Republicans joined 55 Democrats and 2 independents in favor.

The Senate finally adopted the bill at 10:47 p.m. after what appeared to be the longest Congressional vote in history. The peculiar 5-hour 17-minute process was required because Senator Sherrod Brown, Democrat of Ohio, had to return to Washington from his home state after attending a funeral home visitation for his mother, who died Feb. 2.

Image HOUSE: VOTING NO John A. Boehner of Ohio, the Republican leader, criticized the stimulus package as spending, spending and more spending. Credit... Doug Mills/The New York Times

Under a procedural deal between the parties, the bill needed 60 votes to pass. The vote began at 5:30 p.m., but from 7:07 p.m., when Senator Evan Bayh, Democrat of Indiana, cast his “aye,” the tally hung at 59 to 38, until Mr. Brown arrived.