By stumps on the second day, the hosts had declared their first innings at a formidable 719 for five.
The 22-year-old Rahul showed tremendous character and discipline to score 337 while spending 11 hours at the crease. He was finally dismissed, caught by Mukul Dagar off left-arm spinner Ali Murtaza.
Resuming his innings at the overnight score of 150, he played his normal game, belting and blocking according to the merit of the deliveries.
He scored the bulk of his runs against the spinners and, even as the visiting pacers bowled in the right areas initially, the prolific batsman never went into a shell.
"Early on the pacers were bowling in good areas and it was difficult to score off them, but the wicket was easy to bat on, except in the post-lunch session when the wicket was two-paced and cracks opened up," he told reporters after the day's play.
Rahul, who got a century against Australia in only his second Test in Sydney, scored 89 in the previous Ranji match against Baroda.
"The century which I got in Australia really helped me to gather confidence and carry it forward in the domestic season. Yeah, that really helped me - that makes me happy," he said.
His innings, which was studded with 47 boundaries and four sixes, came off 448 balls.
When he went past Barrington Rolland's 283, he became the first Karnataka batsman to score a triple hundred in domestic cricket.
He also became the highest scorer ever against Uttar Pradesh in a first-class match after going past 327 runs, scored by Kedar Jadhav of Maharashtra.
Abrar Kazi also joined in the party, notching his maiden century. He scored an unbeaten 117 off 190 balls, with the help of 14 fours and four sixes. He was involved in a 225-run partnership for the seventh wicket with Rahul.
The lacklustre Uttar Pradesh bowlers struggled to get wickets and conceded far too many runs.
They succeeded in seeing the back of Shreyas Gopal early on after he added two runs to his overnight 88.
Rahul and Chidambaram Gautam (57) then put on 105 runs partnership for the sixth wicket to take the game away from Uttar Pradesh, who are placed at the bottom of the points table.
After the departure of Gautam at 434 for six, Rahul figured in a double century stand with Kazi.
After the departure of Rahul, Karnataka lost Vinay Kumar (2) and Abhimanyu Mithun (8), prompting Vinay to declare the innings after crossing the 700 mark.
The most successful bowler for Uttar Pradesh was Praveen Kumar, who picked up five for 88 in 36 overs.
Image: K L Rahul celebrates after getting to 300 on Day 2 of the Ranji Trophy match against Uttar Pradesh.
Photograph: PTI
Will KL Rahul be the next Dravid?
Exclusive! Coach Jayaraj decodes KL Rahul's meteoric rise
Rahul's dad, a Gavaskar fan, happy son is selected for Aus tour as opener
Ranji Trophy round-up: Yuvraj helps Punjab thrash Haryana
After 6 months of apathy, Mulayam's Rs 5,500 cr thank you to Azamgarh