HONOLULU  President Obama took time out of his Hawaiian vacation on Sunday to sign into law one of the surprise accomplishments of the lame-duck Congress: a measure covering the cost of medical care for rescue workers and others sickened by toxic fumes and dust after the 2001 terrorist attack on the World Trade Center.

To become law, the bill required Mr. Obama’s signature before he returned to Washington on Tuesday, so he signed it at his rented vacation home in the town of Kailua, near Honolulu. There was no signing ceremony, as there would probably have been had the president been at the White House. Instead, Mr. Obama’s official photographer recorded the moment, and the White House said it would release a picture.

The $4.3 billion bill became a major point of contention in the waning days of the Congressional session. Republican senators blocked a more expensive House version, and as it appeared that the measure was going to die, the comedian Jon Stewart took up the cause, using his Comedy Central television program to advocate passage. Ultimately, the Senate approved the less expensive measure; the House quickly followed suit and sent the bill to the president.

Yet Congress did not send the president the enrolled bill  the final, official copy, printed on parchment paper and signed by House and Senate officials  before he left for Hawaii on Dec. 23, according to Bill Burton, White House deputy press secretary.