The man was immediately arrested at the site, which is part of the Dolmabahce complex in Istanbul, CNN-Turk news television reported. It was not immediately clear whether Erdogan was present at the time.
The report said the unidentified assailant was armed with an automatic rifle and a pistol and that he opened fire before throwing the hand grenade, which did not go off. Police then destroyed the device in a controlled explosion, NTV channel said.
Erdogan, who served as prime minister between 2003 and 2014, was elected president last year. The strongman has come under growing accusations of authoritarianism.