With 20.3 per cent of votes counted, the PP was projected on Sunday to win 130 seats and Vox would have 46 seats, according to the interior ministry.
The ruling Socialists, led by Prime Minister Pedro Sanchez, were projected to win 114 seats.
A party or bloc needs 176 seats in the 350-member parliament to form a government.
The vote is the first of several European elections in the next year that could see far-right parties make further gains, starting with France in April.
While negotiations between PP and Vox over the distribution of government posts are expected to be difficult, the two parties already have experience of working together, having governed in coalition in four Spanish regions.
Vox backs tougher immigration controls and lower taxes while opposing climate policies and expanded LGBTQI rights.
Sanchez, who has governed with fragile minority coalitions since 2018, called an early election saying he needed a majority after parliament rejected decrees he proposed to address a mounting housing crisis.
Democracy was restored in Spain in 1978, three years after the death of Francisco Franco, who ruled over the country for almost four decades after a brutal civil war from 1936 to 1939.
Coalition talks face no formal deadline before the first investiture vote, but if no candidate wins parliament's confidence within two months of that attempt, fresh elections are automatically triggered.
The PP says it would prohibit mass amnesties, allow for returns to third countries and introduce a points system for legal immigrants.
Vox wants to deport convicted foreigners and give priority to Spaniards in the queue for housing.