Details on Thursday's deaths were unclear, but the ministry office in the enclave of Ceuta said one of the victims got caught on the tall fence as he tried to climb over.
It was the latest in a series of attempts by hundreds-strong crowds to rush border crossings in Ceuta and another Spanish enclave on Morocco's coast, Melilla.
On Wednesday, 40 Africans were injured in a mass attempt to storm a fence surrounding Melilla. Several hundred managed to get through to Spanish territory, authorities said.
Hours earlier, a group of 500 tried to enter Melilla, trying to climb over on makeshift ladders.
Deputy Interior Minister Antonio Camacho said on Wednesday that his department will reinforce the border with 40 more Civil Guard agents after what he called "serious incidents".
Spain had recently announced that it will double the height of the fence in an effort to make it harder for immigrants to climb over it.
The fence will be raised to 20ft along the 10km long border with Morocco. Camacho said the work is expected to be completed before February 2006.
The fence was built in the late 1990s to keep out illegal immigrants, many of whom are trying to escape poverty in northern or sub-Saharan Africa and find work in Europe.