Costa Rican officials say some 1,200 migrants have crossed into the country illegally from Panama after some attacked a government immigration office at the border.

Security minister Gustavo Mata said Wednesday that migrants from Cuba and unspecified African nations forced their way into Costa Rica at Paso Canoas. He says they damaged a vehicle and clashed with police, before some were sent back to Panama.

Costa Rica shut the border in December while it handled 7,802 Cubans stranded on their journey north to the U.S. when Nicaragua closed its border. Last month, the last of the Cubans were flown to Mexico and El Salvador to continue their trip to the U.S., where they will be admitted.

Panama says 2,329 more Cubans are in shelters near its border with Costa Rica.