Local police put the number at over half a million, while an AFP photographer said at least 50,000 farmers and supporters took part.
The farmers want state authorities to repeal controversial farm legislation.
Organisers described the rally as the biggest protest since their movement began last November.
For days, buses and tractors have been ferrying farmers into the city of Muzaffarnagar, sparking a major security operation.
The Indian government says the laws, which loosen rules around how farmers can sell their produce, will give farmers more freedom.
But opponents say the reforms leave small farmers vulnerable to big corporations.
Thousands of protesters, brandishing flags and wearing coloured caps, spilled onto the streets of Muzaffarnagar on Sunday, with leaders pledging to occupy all roads in a 12-mile (20km) radius around the city.
Thousands of police officers were keeping guard on streets leading to the event.
Protest leaders said the rally in Uttar Pradesh, where farming is critical to livelihoods, would reenergise the movement.
“We’ll intensify our protest by going to every single city and town of Uttar Pradesh to convey the message that Modi’s government is anti-farmer,” Rakesh Tikait said.
The farmers are calling for a nationwide strike on 27 September to protest against the laws.
Thousands have been rallying against the changes for months, blocking major streets in the capital Delhi.
At Sunday’s rally, protest leaders vowed to continue their demonstrations until the laws are dropped.
“We will not leave the protest site [in Delhi] even if our graveyard is made there. We will lay down our lives if needed, but will not leave the protest site until we emerge victorious,” Mr Tikait said, ANI reported.
Key state elections will be held in Uttar Pradesh next year, and protesters styled the rally as a warning to Prime Minister Narendra Modi, whose Bharatiya Janata Party governs the state.
“Our message is very clear – either repeal the laws or face defeat in the state election,” said farmers’ leader Balbir Singh Rajewal.