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.
There was no immediate word on the arrested man's motives.
Erdogan, who served as prime minister between 2003 and 2014, was elected president last year. The strongman has come under growing accusations of authoritarianism.