WASHINGTON — The Department of Homeland Security took the first major step on Thursday toward building a barrier on the border with Mexico, a key campaign promise of President Trump, as officials announced that they had awarded contracts to build several prototypes of a concrete wall.

Four companies will build the prototypes in the San Diego area, said officials at Customs and Border Protection, an agency within the department. The companies selected will each have 30 days to complete the projects after the agency gives them the order to proceed.

“The border wall prototypes and designs will complement other tools we employ to secure our borders,” said Ronald D. Vitiello, acting deputy commissioner at Customs and Border Protection.

Mr. Vitiello said that the prototypes would be about 30 feet high and that the contracts were between $400,000 and $500,000 each. The department has reallocated $20 million from other programs to pay for the prototypes and related costs.