Did Peking University ever belong to the royal family?

Yes, it once belonged to the royal family.

The present address of Peking University is the original site of yenching university, which was given by the former Prince of Qing Dynasty.

Shi Jing University Hall is the first national university in China and the only remaining achievement of the Reform Movement of 1898, that is, the predecessor of Peking University. Its original school site is located in Mashenmiao Street (now Beach Back Street) in Dongcheng. It used to be the residence of the fourth daughter of Emperor Qianlong and Princess Jia. Although it is called Princess House, it was built in full accordance with the regulations of Wang Fu. The hutong next to it was called "Wang Fu Lane" and later renamed "University Lane". 1952 Peking University moved to yenching university campus.