The gunmen damaged properties on the premises but could not gain entrance.
This was disclosed by the anti-graft agency's spokesperson, Wilson Uwajaren, hours after the failed attack.
According to him, the gunmen attacked in the early hours of Wednesday and started shooting in the air before guards on the premises were able to scare them away.
However, they left a threatening death note before they escaped in a getaway vehicle.
According to Uwajuren, the death threat was targeted at Ishaku Sharu, a senior investigator who heads the foreign exchange malpractices fraud section for the agency.
He said, "A major security breach was recorded at the headquarters of the Economic and Financial Crimes Commission, EFCC, in the early hours of Wednesday, August 16, 2017, as unknown gunmen attacked the office located at Wuse Zone 7, Abuja.
"The group of heavily armed bandits invaded the office at about 05:00 hours and began shooting into the premises, damaging vehicles parked in the premises in the process. However, the attack was repelled by guards on duty.
"The hoodlums escaped in a getaway vehicle but not without leaving a message; a white envelope dropped by the fleeing attackers was found to contain a death threat addressed to Ishaku Sharu, a senior investigator with the commission.
"Ishaku who heads the foreign exchange malpractices fraud section is in charge of corruption investigation involving several politically exposed persons and retired military brass hats."
The office houses the anti-graft agency's AMCON Desk, Procurement Fraud and Foreign Exchange Malpractices Sections.
Uwujaren said the police is already investigating the incident.