Police said in a statement that the staff member suffered minor injuries and went to the hospital on his own.
The statement said detectives are investigating the incident, with the help of forensic and intelligence investigators.
Ukraine’s embassy in Spain was not immediately available.
State broadcaster TVE reported that the area around the embassy had been cordoned off.
(Reporting by Belen Carreno; Writing by David Latona; Editing by Aislin Lang and Frank Jack Daniel)