The shocking incident took place in front of Judge Begum Fatema Ferdous of Cumilla Sessions Judge (third) court in the courtroom.
The deceased and the attacker happen to be cousins.
Cumilla Police Super Syed Nurul Islam said accused Hasan started stabbing Faruk with a knife indiscriminately while the hearing in the murder case was going on in the court around noon, leaving him critically injured.
Faruk was taken to Cumilla Medical College Hospital where doctors declared him dead.
Security was tightened on the court premises after the incident, the SP added.
Hasan was arrested after the incident, he said.
Meanwhile, a three-member committee, headed by Shakhawat Hossain, additional superintendent of police (crime), has been formed to look into the matter.
The committee has been asked to submit its report within three working days.