Sonko, who is very popular with young people, has called the trial a political scheme to sabotage his 2024 presidential ambitions.
The criminal court’s president said a verdict is expected on June 1, after the latest hearing went on until the early hours of Wednesday.
The trial continued on Tuesday after the court dismissed requests by Sonko and his co-defendants for a delay after he missed the legal showdown for the second time in a row.
Sonko faces charges of rape and threatening to kill an employee of a beauty salon in Dakar.
Sonko, 48, said he went to the salon for a massage to treat his chronic back pain and denied any attack.
Complainant Adji Sarr repeated her allegations in Tuesday’s hearing, saying Sonko had abused her five times. She also said she had gotten death threats.
Sonko’s trial started on May 16 but was immediately postponed until May 23 after he did not show up.
Sonko said he was afraid for his safety and said he would not come to court without state assurances for his personal security.
Sonko is thought to be in the southern city of Ziguinchor, hundreds of kilometres (miles) away from Dakar, where he is mayor.
Sonko could lose his eligibility to run if found guilty.
Sonko, leader of the PASTEF-Patriots party, finished third in the 2019 election against incumbent Macky Sall.
Senegal is usually a model of stability in troubled West Africa, but in recent years has faced unrest that has sometimes turned fatal.
Sonko’s arrest in 2021 sparked several days of riots that killed at least 12 people.
Three more people died during clashes between Sonko supporters and police before the trial began on May 16.
Political tensions have also been fuelled by Sall’s refusal to rule out a third term as president, which his rivals say would violate the constitution.
Sall was elected in 2012, when the presidential term was seven years, and re-elected in 2019, when the term was shortened to five years.