The European Union's competition chief left the door open to the possibility of the U.S. government taking a stake in two of the continent's top 5G players — Nokia and Ericsson — as long as there is no risk to security.

U.S. Attorney General William Barr said earlier this month that the government should consider taking a controlling stake in Nokia, Ericsson or both in order to "blunt" Chinese firm Huawei's "drive to domination" in next-generation mobile networks known as 5G.

Nokia and Ericsson are two of the biggest networking equipment makers and direct competitors to Huawei.

Margrethe Vestager, the EU's competition commissioner, told CNBC Tuesday that it's up to the "businesses to answer if they are for sale or not" but it's up to European lawmakers "to make sure that every risk is assessed."

"Here in Europe we are neutral on ownership, you can be state owned or privately owned, what is important for us is that you act as a market operator that you have a real business case for what you do," Vestager told CNBC's Silvia Amaro.

"So, you know, I have no specific point if the U.S. state would want to buy a stake, and I don't know if there is a stake in Nokia, Ericsson that is for sale," she added, essentially leaving the door open to a move.