A bomb placed under a car has exploded in Egypt's second city of Alexandria, killing two people including a policeman, two days before the country is due to hold a presidential election.

The bombing, which wounded four other policemen, targeted Alexandria's security chief, police Major General Mostafa al-Nemr, the interior ministry said.

There was no immediate claim of responsibility for the bombing.

Islamic State released a video last month in which it warned Egyptians against taking part in the upcoming vote and urged Islamists to attack security forces and leaders.

State news agency MENA quoted Mr Nemr as saying that two people, a policeman and a driver, were killed in the blast.

Photos on social media showed a burnt out car and smoke at the site of the blast.

"On Saturday March 24 an explosive device planted underneath a car exploded … as the Alexandria security chief drove by," the interior ministry said in a statement.

Eyewitnesses said police and military personnel formed a cordon around the site of the explosion.

Local television stations later showed Mr Nemr unharmed and inspecting the area.

Electoral opponents cite intimidation

IS had attempted to assassinate Egypt's defence and interior ministers in December during a trip the pair made to the Sinai Peninsula, where the hardline militant group has been waging an insurgency for almost five years.

President Abdel Fattah al-Sisi said on Friday that IS militants would soon be defeated in the Sinai as he visited troops battling the jihadists there.

Polls will open on Monday when voters choose between Mr Sisi and one little-known candidate who supports the former field marshal.

All credible opponents dropped out in January, citing intimidation by the authorities after the main challenger was jailed.

Mr Sisi's critics say he has cracked down harshly on dissent and that tough economic reforms have eroded his popularity.

Supporters say such measures are needed to stabilise Egypt, which was rocked by years of unrest after protests toppled veteran leader Hosni Mubarak in 2011.

State news blames Muslim Brotherhood

As military commander, Mr Sisi led the ousting of Egypt's only competitively-elected leader, President Mohamed Mursi, a member of the Muslim Brotherhood, who was toppled amid demonstrations against his rule in 2013, a year after taking power.

Mr Sisi took office with a landslide election victory a year later.

State news agency MENA blamed the Brotherhood, which is now banned in Egypt and designated a terrorist group, for Saturday's bombing.

"This attempt comes in the context of terrorist Muslim Brotherhood elements trying to disrupt the electoral process and influence citizens into not going to the polls and participating in the presidential election," the agency said.

IS and other militant groups have successfully assassinated officials in recent years.

IS bombed a hotel in Sinai in 2015 during a parliamentary election, killing seven people including two judges overseeing the vote.

Egypt's top public prosecutor, Hisham Barakat, was killed by a car bomb in June 2015.