LONDON (AP) _ The government on Wednesday formally introduced its controversial bill that would grant British citizenship to an estimated 225,000 Hong Kong Chinese.

It faces stiff opposition and possible defeat by a rare union of the socialist Labor Party, which considers the bill elitist, and right-wing legislators in the governing Conservative Party opposed to mass immigration.

The bill was presented to Parliament hours after Prime Minister Margaret Thatcher said Britain had a ''solemn duty'' to the colony before it reverts to China in 1997.

Thatcher said that giving key people a safety outlet was essential to prevent a crippling brain drain over the next seven years and ''to keep the prosperity going'' in Hong Kong.

But former Conservative Party Chairman Norman Tebbit said as many as 80 right-wing Tories have threatened a revolt against the government.

The Labor Party's leadership on Wednesday night voted unanimously to oppose the bill. Deputy leader Roy Hattersley said it granted citizenship on the basis of ''wealth, power and influence'' and would not achieve its objective of keeping key people in Hong Kong.

Hong Kong is subject to British rule under a 99-year lease with China signed in 1898. Hong Kong will revert to Chinese control on July 1, 1997, under terms of a joint declaration signed by Britain and China in 1984.

The British Nationality, or Hong Kong, Bill allows the Home Secretary to grant citizenship ''before June 30, 1997, up to 50,000 Hong Kong residents recommended by the governor of Hong Kong under a selection scheme to be approved by Parliament.''

Citizenship also will be granted to the spouses and young children of the key residents. Foreign Secretary Douglas Hurd has estimated this will bring the total to 225,000 people.

Under the bill, Hong Kong governor Sir David Wilson will appoint a committee to advise him on the citizenship issue. Most of the 50,000 will be chosen on a ''points system.''

The measure was given a formal first reading in the House of Commons but the first major test will come in the second reading on April 19.

Home Secretary David Waddington said he was confident the bill would be adopted.

''I am sure we will persuade enough Members of Parliament to carry the measure,'' Waddington told Channel 4 TV News.

But Conservative opponents already were gearing for battle.

''The government are about to do something which I never thought I would live to see - legalizing an activity which was criminal, namely creating a market in passports,'' said Robert Adley, chairman of the British-Chinese Parliamentary Group.

''The employment market will be distorted by jobs to which British passports are attached. This scheme is going from the bizarre to the bazaar,'' Adley said.

In 1989, 42,000 people left Hong Kong and 55,000 are expected to leave in 1990, he said.

About 3.25 million Hong Kong Chinese now have British passports, but no residence rights.