First Minister Nicola Sturgeon will face political rivals in the event two weeks before the June 8 vote which will be chaired by the broadcaster's political editor Bernard Ponsonby.
A UK-wide leaders debate appears to have collapsed after Theresa May announced she would not be taking part prompting Labour leader Jeremy Corbyn to also pull out.
Ms Sturgeon will face Ruth Davidson of the Scottish Conservatives, Scottish Labour's Kezia Dugdale and Scottish Liberal Democrat leader Willie Rennie.
Gordon Macmillan, STV's head of news, said: "STV has a strong track record of delivering election debates for viewers in Scotland.
"This is an exciting time in Scottish and UK politics and we've rarely seen public political engagement so high.
"STV's debate will give members of the audience an opportunity to put their questions to the leaders of the four main political parties and the leaders will also cross-examine each other.
"We hope viewers tune in for an engaging debate about the key political issues in Scotland today."
The debate will be broadcast live from the Tramway theatre in Glasgow on Wednesday May 24 between 8.30pm and 10pm.