The court said more than 130 people attended the trial, including members of the country's top political advisory board and media reporters.
But some 20 plainclothes officers prevented an AFP reporter from entering the court and surrounded the journalist for more than 20 minutes, saying she should have registered to attend the hearing in advance. One officer pushed the journalist back and shouted.
Sun, 54, had once been tipped for promotion to the Politburo's elite seven-member standing committee, which rules the country and is presided over by Xi. As the youngest Politburo member, Sun was even seen in some quarters as a potential successor to Xi.
Sun was the first serving member of the elite 25-person Politburo to be placed under investigation since Bo Xilai, another former leader of Chongqing, who was jailed for life in 2013.
Government corruption is rampant in China, and Xi has presided over a much-publicised anti-graft campaign since coming to power in 2012, but some have compared it to a political purge.
Xi, who has become China's most powerful leader since Chairman Mao Zedong, now has a path to rule for life after the rubber-stamp legislature lifted presidential term limits last month. Xi's second presidential term expires in 2023.
The National People's Congress also expanded Xi's anti-graft campaign by creating a national supervision commission that will look beyond party officials and scrutinise millions of public servants at all levels of government.
Sun's case showed that the party had some concerns about potential vulnerabilities to its rule.
In October, senior party official Liu Shiyu congratulated Xi for foiling the efforts of powerful officials who "plotted to usurp the party's leadership and seize state power."
Liu listed former security czar Zhou Yongkang alongside Sun and Bo as part of the conspiracy, which was rumoured to have involved military officials. All three have been ousted from the ruling Communist party (CCP) and arrested or jailed on corruption charges.
Sun was expelled from the CCP in September after an investigation by the party's disciplinary body found the politician had abused his position by taking bribes and trading power for sex.
Sun was also accused at the time of nepotism, sloth, leaking confidential party information and betraying party principles. As the country's fourth largest city and an industrial metropolis in the southwest of the country, Chongqing is a major post for ambitious politicians.
When Sun became the Chongqing's chief in 2012, he was tasked with erasing Bo's influence on the city. But last year the party's discipline inspectors publicly rebuked Sun for failing to get the job done, and his downfall came months later. Sun was replaced in the city by Chen Miner, a former Xi aide whose profile was elevated by the move.
Chen was given a spot on the powerful 25-member Politburo at the Communist Party Congress in October.