"Eight employees were wounded, four of whom are in a serious condition," said the secretary to the rabbi of the Bolshaia Bronnaia Street synagogue.
Three 18-year-old men, a rabbi, and the head of security and other synagogue staff were hospitalised, according to the official.
A US citizen, an Israeli and a Tadjikistani were also hurt, the Ria Novosti news agency reported, quoting the prosecutor's office.
Chief Rabbi Yitzhak Kogan said evening prayers had begun when the attacker entered the building's first-floor canteen.
"There was evening prayer. I heard screams. Running out I saw an unidentified man running away from me. I saw three or four people cut up further down the corridor," he said.
The hospitalised rabbi was operated on later Wednesday evening.
The attacker, named by Russian media as Alexander Koptsev, 20, was arrested and has been charged with attempted murder on religious or ethnic grounds.
Local media and synagogue officials described him as a skinhead who belonged to an extremist organisation.
Russia's foreign ministry voiced "deep sympathy" for the injured and wished them good health while condemning the "criminal act."
"We most resolutely condemn such actions. Provocations of those who seek to split Russian society and spark ethnic and religious hatred, were never successful and never will be," the ministry said in a statement.
"We will continue an uncompromising fight against all outbreaks of anti-Semitism, xenophobia and religious intolerance," the statement published on the ministry's website added.
Also Wednesday, two Sudanese students were attacked in the southern town of Voronezh, the latest of a series of apparently racist attacks of foreigners.
Anti-Semitic acts are common in Russia. In October, dozens of graves in a Jewish cemetery in St Petersburg were vandalised.
Assaults, some of them deadly, on foreigners are also growing more common and are frequently carried out by groups of skinheads.
About 44 racist murders were committed in Moscow in 2004, according to a human rights organisation in the city.
