Yu Garden or Yuyuan Garden ( lit. Garden of Happiness or Garden of Peace is an extensive Chinese garden located beside the City God Temple in the northeast of the Old City of Shanghai, China. Yu Garden was first conceived in 1559 during the Ming Dynasty by Pan Yunduan as a comfort for his father, the minister Pan En, in his old age. Pan Yunduan began the project after failing one of the imperial exams, but his appointment as governor of Sichuan postponed construction for nearly twenty years until 1577. The garden was the largest and most prestigious of its era in Shanghai, but eventually its expense helped ruin the Pans.
The garden was inherited by Zhang Zhaolin, Pan Yunduan's granddaughter's husband, and then passed to different owners. A section was briefly organized by Zhang Shengqu as the "Academy of Purity and Harmony" and the Ling Yuan ( "Spirit Park"), today's East Garden, was purchased by a group of local leaders in 1709. A group of merchants renovated the increasingly decrepit grounds in 1760 and in 1780 the West Garden was opened to the general public.