The attacker refused to stop at the presidential palace's western gate before seizing a gun from one of the guards, killing two of them and being shot dead himself, presidential press secretary Emad Sidahmed told AFP.
Bashir and his ministers were not in the palace at the time of the attack, Sidahmed said.
The president, who took power in a 1989 Islamist-backed coup, has a separate residence near the military headquarters in Khartoum.
Army spokesman Colonel Al-Sawarmy Khaled Saad said the attacker, whom he described as "insane", arrived at the gate with a sword, which he used to stab one guard.
The man then grabbed a gun, shooting the wounded guard dead and killing another before other soldiers opened fire on him, Saad said.
In a statement, Saad named the attacker as Salah Kafi Quwa, and said he was originally from the town of Kadugli in South Kordofan state, where insurgents are battling the Khartoum government.
The president's office suggested that the attacker was mentally ill in a separate statement, but gave no further details.
Witnesses near the palace said they had heard shooting coming from the palace around 12.30 pm.
A lawyer whose offices are 200 metres (yards) from the palace said the gunfire was so loud that he had ducked for cover.
"I heard shooting coming from the direction of the palace and I hid under my office table," he said, asking not to be named.
"After it stopped I saw armed soldiers at the south gate of the palace and also police vehicles arrive nearby."
"I closed my shop and tried to hide away, and the shooting continued for 15 minutes," he said.
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
