The bus carrying 55 people, mainly Moroccans, collided with the truck at around 3am (9am, Singapore time) near the town of Montoro in Cordoba province, a local police spokesman said.
The driver and another Spaniard were killed while four others were seriously injured. Another 42 passengers suffered light injuries.
The majority of the passengers were foreigners, including 31 Moroccans, two Singaporeans and one national each from Mauritania, Ecuador, the United States, Romania, the Ivory Coast and Colombia.
The bus was travelling from the port of Algeciras to Madrid.
In March, 13 students were killed and dozens more injured in Spain when the driver of their coach lost control and crashed into an oncoming car in the north-eastern region of Catalonia as they returned from a festival.