CALGARY, Alberta, Nov 16 (Reuters) - TransCanada Corp has shut part of its Keystone pipeline after 5,000 barrels of oil leaked in Amherst, South Dakota, the company said on Thursday, four days before the state of Nebraska is due to decide on an expansion of the system.

The pipeline from Hardisty, Alberta to Cushing, Oklahoma, and to Patoka, Illinois, has been shut, while the southern leg of the system to the Gulf Coast remains operational, the company said. (Reporting by Ethan Lou; Editing by Dan Grebler)