WASHINGTON — The Federal Communications Commission voted on Friday to bar cellular carriers from using federal subsidies to buy equipment from Huawei and ZTE, two Chinese companies, saying the companies endangered national security.

The rules put new restrictions on money earmarked for expanding broadband to underserved areas of the country, including rural areas, where building internet infrastructure can be prohibitively expensive without government support.

The agency’s five commissioners unanimously approved the proposal. They said the move was vital as American wireless carriers rolled out the next generation of wireless technology, known as 5G. The new restrictions could eventually cover additional companies.

“In taking these steps, we demonstrate the F.C.C.’s commitment to doing everything we can to address national security threats to our communications networks,” said Ajit Pai, the agency’s chairman.