Sanchez's Socialists, who came second in an inconclusive general election on December 20th, face the vote after conservative acting Prime Minister Mariano Rajoy said he did not have the support to form an administration himself.
To become prime minister Sanchez needs to win an absolute majority in the first round of voting in the 350-strong lower house of parliament.
But the Socialists, who won 90 seats in the general election, have only the support of new market-friendly party Ciudadanos, which has 40 – not enough to see them through.
Both Rajoy's Popular Party (PP), in power since 2011, which came in first with 123 seats and new far-left party Podemos with its 65 seats, vowed on Wednesday to vote against Sanchez.
Rajoy told Sanchez he would vote against him “because you plan to eliminate what was achieved in Spain throughout these past four years which prevented this country from needing a bailout, created jobs, improved its competitiveness and caused it to grow economically.”
Spain's economy grew 3.2 percent in 2015, one of the fastest rates in Europe, although the unemployment rate remains high at 20.9 percent.
Podemos leader Pablo Iglesias accused Sanchez of proposing policies similar to those of PP favouring the wealthy, as he too said his side would not support the Socialists.
“You want to consolidate the main policies of the PP,” said Iglesias, a pony-tailed political science professor.
Sanchez appealed to leftist lawmakers on Tuesday to join in alliance to oust the PP, arguing in the assembly that Spain voted decisively for change in last year's election.
He said a Socialist-led government would enact progressive measures such as a minimum wage increase and a gender wage-gap law, and stressed that all sides would need to compromise as no single ideological group has enough seats for a majority.
“Why don't we unite to form a government for change? Why don't we get together and pass as many reforms as possible to solve the most urgent problems of Spaniards?” he asked the assembly.
The confidence vote is expected at around 9 pm (2000 GMT).
If he fails Sanchez has another chance on Friday in a vote in which he would only need more votes in favour than against.
If he fails in both votes, Spain will be plunged into uncharted territory.
It would be the first time since the country returned to democracy following the death of dictator General Francisco Franco in 1975 that the candidate designated by the king did not get enough backing from parliament.
A two-month countdown will then start from Wednesday, during which the wildly diverging parties will try once again to come to an agreement to govern Spain.
Failing that, new elections will be called, most likely on June 26th.
That would leave Spain in political limbo for several more months just as the country emerges from a severe economic crisis, and also faces an independence threat in the northeastern region of Catalonia.
Rajoy gave up attempts to form a government after he failed to get support from other groupings fed up with years of crisis-sparked austerity and corruption scandals plaguing his party.
So King Felipe VI then asked runner-up Sanchez, whose Socialists scored their worst result in history, to form a government.
After weeks of negotiations and ping-pong televised statements, he sealed a deal last week with Ciudadanos.
“Spaniards want a change. Stop fighting,” Ciudadanos leader Albert Rivera said Wednesday.
But Podemos, which with its 65 seats would be a valuable partner for Sanchez, immediately suspended talks with the Socialists over the agreement, which it considered too liberal.