THE negotiators came to the deal just before midnight on Thursday.
A smaller team of British negotiators led by Alan Paul agreed on the final version of the Hong Kong Court of Final Appeal Bill at 11.45 pm, said a source close to the talks.
The team slipped into the Chinese office of the Joint Liaison Group (JLG) in the China Resources Building in Wan Chai after a meal at Government House at about 9 pm.
To avoid reporters, Mr Paul and his Chinese counterpart, Chen Zuo'er, said after the day's nine-hour meeting that they would keep in touch.
The two sides had already agreed on the draft bill on Wednesday when they resumed talks following a three-day round last week.
Thursday was largely devoted to the fine print while another team of experts studied the text of the five-point agreement.
Government printers started the presses overnight. 'It's magic,' the source said, holding a copy of the bill.
But it was followed by a hectic day selling the deal.
The Governor briefed his senior advisers in the Executive Council at 9.30 am. The JLG experts returned to Kennedy Road at 11 pm to finalise the wording of the deal.
The source admitted that 'things have moved very quickly' in the past week after the Chinese side put forward its 'package of resolutions'.
But he refused to confirm whether the Chinese had proposed delaying setting up the court until after July 1, 1997.
And no explanation was given for why the British had decided so quickly to accept the delay to the court.
CHRONOLOGY SEPT 91: JLG agrees early establishment of the court.
DEC 91: Legco rejects the '4:1' deal.
MAY 94: Draft bill given to China.
NOV 94: Consultation among legal profession.
MAR 95: Experts' meetings resumed.
MAY 3, 95: Legco approves motion to demand flexibility of judges and the court being set up at earliest possible time.
MAY 16, 95: PWC political sub-group agrees an eight-part alternate plan.
MAY 18, 95: Lu Ping says court will definitely be in place on July 1, 1997.
MAY 23, 95: Exco accepts PWC views in amended bill.
JUNE 6, 95: Qian Qichen says the court should be delayed until July 1, 1997.
JUNE 9, 95: China and Britain sign agreement.