Leonid Volkov, one of the main figures of the Russian opposition, blamed President Vladimir Putin for his death.
His attack also occurred a few days before the presidential election which should extend the mandate of the head of the Kremlin.
Mr. Volkov claimed on Telegram that he was hit in the leg 15 times during the attack on Tuesday evening.
Someone broke a car window and sprayed tear gas in his eyes before hitting him with a hammer, Kira Iarmich, Mr. Navalny's ex-spokesperson, testified earlier .
Mr Volkov's wife, Anna Biryukova, posted photos on social media showing her husband's injuries, including one black eye, a red mark on his forehead and blood on his leg.
A government source told AFP that Mr. Volkov was released early Wednesday from the hospital where bruises were noted on various parts of his body as well as a fracture of a bone in his hand.
More serious injuries were avoided, said this source.