Video report by ITV News Asia Correspondent Debi Edward
Liu Xiaoming was called to a meeting where the Foreign Office's permanent secretary Sir Simon McDonald said the imposition of the legislation breaches the Sino-British Joint Declaration.
The meeting comes just hours after China imposed the legislation on the city.
The national security law targets secession, subversion, terrorism and colluding with foreign forces with punishments up to life in prison.
Sir Simon made clear the UK's "deep concern" over the new law, which came into effect in Hong Kong on Monday, without the details being published first.
Foreign Secretary Dominic Raab said if Beijing tried to stop people with British National (Overseas) status from leaving Hong Kong, there would be little that could be done by the UK.
He told ITV’s Peston programme: “Ultimately if they follow through on something like that there would be little that we could do to coercively force them.”
Acts of vandalism against government facilities or public transport can be prosecuted as subversion or terrorism, while anyone taking part in activities deemed as secessionist would also be in violation of the new law.
The law directly targets some of the actions of anti-government protesters last year, which included attacks on government offices and police stations, damage to subway stations, and the shutdown of the city’s international airport.
The new national security law further blurs the distinction between the legal systems of semi-autonomous Hong Kong, which maintained aspects of British law after the 1997 handover, and the mainland’s authoritarian Communist Party system.
Mr Raab continued: “There is an issue around freedom and human rights in Hong Kong, and there is an issue around China keeping its word on an international obligation it made to the United Kingdom back in 1984."
ITV News Asia Correspondent Debi Edward explains how China is likely to react to Britain's offer to the people of Hong Kong
“I wouldn’t want to be naive about this: I think we need to be realistic. But I do think that China as a rising, leading member of the international community is sensitive to the reputational risk in all of this but clearly not sufficiently that it hasn’t proceeded anyway…
“There is diplomatic leverage, there are other ways that we can persuade China not to fully implement either the national security law or some of the reprisals you talk about.
“But ultimately we need to be honest that we wouldn’t be able to force China to allow BN(O)s to come to the UK.”
Hong Kong’s leader has strongly endorsed the new security law China’s central government is imposing on the semi-autonomous territory in her speech marking the anniversary of its handover from colonial Britain.
“This decision was necessary and timely to maintain Hong Kong’s stability,” Carrie Lam said.
Boris Johnson said on Tuesday the UK government is "deeply concerned" by the legislation, adding "we will be setting out our response in due course".
A pro-democracy political party, The League of Social Democrats, organised a protest march during the flag-raising ceremony preceding Ms Lam’s speech.
Participants chanted slogans echoing demands from protesters last year for political reform and an investigation into alleged police abuses.
President Xi Jinping signed a presidential order making the law take effect after its approval by the Standing Committee of the National People’s Congress, China’s rubber-stamp legislature, and it has been added to the Basic Law, Hong Kong’s constitution.
Hong Kong's last British governor has told ITV News China's passing of a new national security law puts an end to the "one country, two systems" framework, which was agreed when the territory was handed back to Beijing 23 years ago.
Chris Patten watched as the Union flag was lowered over the former colony on July 1, 1997, following more than 150 years of British rule.
As part of the handover, Beijing signed an agreement, lodged at the UN, to respect Hong Kong's autonomy and all that came with it - freedom of speech, assembly and an independent judiciary - for 50 years.But in an interview with ITV News,
Lord Patten told ITV News Correspondent Ivor Bennett the new legislation, which criminalises sedition and subversive activities, will "drive a coach and horses" through that agreement, and will put in danger the civil liberties it was supposed to uphold.
"If Hong Kong is damaged, it's because of Xi Jinping" he said, before accusing China's current leader of "turning the screw" on Hong Kong.