The 47-year-old Congress leader appeared before civil judge A I Sheikh in Bhiwandi, who read out the charges levelled against him and also the statement of the complainant Rajesh Kunte.
Kunte had filed the case in 2014 after watching Gandhi's speech at an election rally in which he had claimed that the RSS was behind the killing of Mahatma Gandhi.
After reading out the complaint against Gandhi, the judge asked him, "Do you accept the charges?"
To this, Rahul Gandhi replied, "I plead not guilty."
The court then proceeded to frame charges against the Congress leader under IPC sections 499 (defamation) and 500 (punishment for defamation).
Under section 500, a person found guilty of defamation faces simple imprisonment for a term which may extend to two years, or with fine, or with both.
The court fixed August 10 as the next date of hearing, when the actual trial will begin.
Emerging from the court, Rahul Gandhi said if need be, he would be present in the court again.
"Let them (the BJP and the RSS) slap as many cases as they want against me. Ours is a fight of ideology. We will fight them and win," he told reporters outside the court.
On May 2, the court had asked him to appear before it today.
Gandhi, who arrived in Mumbai this morning, reached the magistrate's court at 11.05 am amid heavy security cover and was greeted by supporters who raised slogans in his favour.
He was accompanied by Maharashtra Congress chief Ashok Chavan and some other party leaders.
In the court room, Gandhi's counsel Narayan Iyer and the complainant's lawyer Dharghalkar argued over the issue of the submissions made by Rahul Gandhi in the High Court where he had submitted the transcript of his speech made during the said election rally at Bhiwandi on March 6, 2014.
The issue of taking it on record in this court was hotly debated and remained inconclusive.
"As per the charge, you (Gandhi) on March 6, 2014, in a rally held for elections at Bhiwandi, Thane, defamed the organisation to which the complainant belongs," the judge said while reading out the charge.
"Your speech, which was telecast on channels and also published in newspapers, damaged the reputation of the complainant and his organisation and you thereby committed an offence under sections 499 and 500 of the Indian Penal Code (IPC)," he said.
The judge also read out Gandhi's remarks which he had made at the rally and were cited by the complainant.
Rahul Gandhi left the court at 12.15 pm.
"On the next date of hearing, the court is likely to pass an order on whether certain documents, including the transcript of the video recording of Gandhi's speech submitted by the complainant, can be admitted as evidence or not," Iyer said.
Rahul Gandhi is not required to appear before the court on the next date of hearing, he said.
The court today also allowed an application filed by Rahul Gandhi last month seeking a summons trial, which would mean detailed recording of evidence, instead of a 'summary trial'.
While trials in such cases are normally held summarily, Rahul Gandhi filed an application last month seeking for it to be conducted as a 'summons trial'.
"A summary trial is short and will be completed by just submitting the written arguments. We have sought for a summons trial which would go into the in-depth recording of the evidence," Iyer said.
"The case relates to historical facts and hence, we need to rely on several documents and would like to record the evidence of experts," he said.
After the court proceedings got over, Kunte said, "I have full faith in the court and I am sure justice will be delivered."
Rahul Gandhi had earlier moved the Supreme Court seeking quashing of the case.
The apex court had in July 2016 said he should not have resorted to "collective denunciation" of an organisation, and would have to face trial if he did not express regret for his remark.
The Congress leader had declined to accept the suggestion and expressed willingness to face the trial.
In the court room today, Rahul Gandhi and the complainant sat at the extreme corners for about one hour while their counsels were examining the documents.
At one point of time, the SPG officials got annoyed as Rahul Gandhi was made to use a toilet, which was in dilapidated condition, instead of taking him to the bar room washroom.
Kunte, on the other hand, alleged that the police had given special treatment to Rahul Gandhi while he and his counsel were whisked away and subjected to a thorough checking before they entered the court room.
The road leading to Bhiwandi had huge hoardings which said, 'Rahul Gandhi, Sangarsha Karo'.
The hoardings were later pulled down due to the model code of conduct in place for the MLC elections scheduled for June 25.