This is not the same Denethor who ruled Gondor at the time of the War of the Ring, but his distant ancestor; for details of that later bearer of this name, see the entry for Denethor II
Denethor I was the tenth Steward to rule Gondor, in whose time the realm suffered perhaps the most calamitous upheaval in its history. When Denethor succeeded his childless uncle Dior in III 2435, Gondor had known peace for many generations. Nearly four hundred years earlier, during the Stewardship of Denethor's noble ancestor Mardil, Gandalf had gone to Dol Guldur and forced Sauron to withdraw into the east of Middle-earth. Though it was known that the Nazgûl still infested Minas Morgul, they offered no threat to the South-kingdom, and Denethor had every reason to hope that this time of Watchful Peace would continue in his time.
He was wrong. III 2460, the twenty-fifth year of Denethor's rule, would be the last year to see Gondor fully at peace for nearly six centuries. In that year, Sauron gave up his exile and returned to his fortress of Dol Guldur in Mirkwood. Just a few years later, it was seen that the Nazgûl had not been idle in the years of the Peace - they unleashed a force of hideous soldier-orcs on Gondor, of the kind that would become known as the Uruk-hai. These Orcs ravaged Ithilien and took Osgiliath, but Denethor's heir Boromir fought them back and recovered Gondor's holdings east of the River, though he was dreadfully wounded. These were the first skirmishes in a conflict that would not truly end until the time of the War of the Ring.
Denethor I ruled as Steward for forty-two years, and was succeeded by his son Boromir.
Notes
1
The date of Denethor's birth appears only in The History of Middle-earth volume XII, The Peoples of Middle-earth. It cannot therefore be considered completely reliable.