Sinn Fein's Martin McGuinness and Peter Robinson, DUP leader, stood side by side Friday with Brown and Brian Cowen, the Irish prime minister, to unveil the breakthrough in Belfast.
Sinn Fein had threatened to withdraw from the power-sharing government, unless the DUP accepted a deadline for the power handover.
The move would have triggered the collapse of the key achievement of Northern Ireland's historic 1998 peace accord, set up to end nearly 30 years of conflict.
"This might just be the day when the political process in the north [of Ireland] came of age," McGuinness, who is senior Catholic minister in the unity government, said.
The US applauded the new justice agreement, due to come into force on April 12, and urged local political leaders to take greater responsibility for the province's future.
"Today, Northern Ireland has taken another important step toward a full and lasting peace," Hillary Clinton, the US secretary of state said on Friday.
"I want to applaud all the parties for ultimately choosing negotiation over confrontation," she added.
"Now they have even greater authority, and with that authority comes greater responsibility. They must continue to lead."
Clinton, who has been in regular contact with both sides since her visit to Belfast last October, said she would host Robinson, who is Northern Ireland's first minister, and McGuinness in Washington in the near future to discuss ways to build on the new agreement.
The deal happened after Robinson persuaded his party's divided politicians to back a new round of compromise with the predominantly Catholic Sinn Fein, despite Protestant fears about giving former IRA fighters any role in overseeing Northern Ireland's police and courts.
But both premiers were confident that handing over power to a new Justice Department in Belfast represents the last major step in a decade-long effort
to make power-sharing work.
Brown and Cowen last week launched a personal mission to prevent the collapse of Northern Ireland's four-party coalition, which was established in 2007 to help end a conflict that had claimed 3,700 lives since the late 1960s.
The two-and-a-half-year-old coalition and its predecessors had repeatedly broken down and failed to show that divided local politicians can govern Northern Ireland better than Britain did.