Cirith Ungol is the name of the pass through the western mountains of Mordor and the only way towards the land from the West.
Its principal purpose was to defend Ithilien from attacks from Sauron's remaining servants. For that reason its two bastions were directed to the north- and southeast. It also served to stop Sauron's servants from returning to Mordor.
Gondor occupied the fortress probably till T.A. 1636 when the Great Plague killed large parts of Gondor's population. After the Plague Gondor never again occupied Cirith Ungol and evil was allowed to return to Mordor. The fortress was associated with the mountain fortress of Durthang (Northwestern Mordor).