Donald Trump said he would ban US companies from building AI data centres overseas and threatened a “tremendous tax” for firms that do so, but gave few details about the potential policy.

“We're going to keep it all in this country,” Trump said at a press briefing after returning from a trip to Asia. He added: “We're not going to allow our companies to build data centres outside of our country,” saying China would otherwise “take all of them”.

Trump acknowledged that the proposal had not been discussed with his staff. “I don't know if that's a breaking story, but I haven't even said that to my people. But I'm telling them now, they're here,” he said. It remains unclear whether the idea will become policy or how it might be enforced.

The comments followed an announcement earlier this week that would require firms to obtain a licence to buy advanced computer chips. Washington said the licensing system would allow officials to monitor whether chips were being used to serve Chinese companies or smuggled into China. The restrictions could affect South East Asian countries that have invested heavily in data centres, as Chinese companies seek to rent computing power overseas.

Data centres have also featured in US midterm election campaigning. Many Democratic candidates who promised tougher rules on their construction won on 3 November, amid concerns including noise pollution and energy use. Trump said communities should benefit from hosting the facilities: “You ought to take advantage of the data centres. Make them pay you, make them pay your community, but take advantage don't shut them off,” he said.

There were about 3,000 data centres across the US as of April, with another 1,500 at various stages of approval and construction, according to the Pew Research Centre. The facilities house computer chips and servers used to run AI programmes such as Claude and ChatGPT.

Tech companies including Meta and Google have made overseas data-centre plans. Meta has broken ground on a facility in Alberta, Canada, while Anthropic has signed a long-term agreement to lease a proposed centre in Nova Scotia. Google announced a €13bn ($15bn: £11bn) investment in AI infrastructure in Finland in September, including funding for three data centres. Building work on two was halted last month over concerns about clearing more than 300 hectares of forest.

Trump referred specifically to Google's Finland project, saying his administration was “not allowing that to happen”. Meta and Google were contacted for comment on his remarks.