TAIPEI—More than 1,000 students have occupied Taiwan's legislature to protest the ruling party's handling of a trade pact with China that has become a divisive political issue for the island.

Prepped with sleeping bags and food supplies, the university students broke into the main assembly hall in the Legislative Yuan building Tuesday night and then blocked the entrances with chairs.

Police...