For many years (since T.A. 2901) the land of Ithilien had been held by Sauron's forces, but he had not breached the Anduin to attack deeper into Gondor, biding his time as he marshaled his strength.2 By the end of the Age, Sauron had gathered all he could from the Rings of Power and started searching for the One Ring in Anduin. In T.A. 2951 he declared himself openly, gathered forces and fortified Mordor.1
In 3009 Gollum was captured after he had ventured into Mordor and the Dark Lord learned that his Ring was in the Shire, a location unknown to him. Gollum was released from Mordor in 3017 and was soon taken by Aragorn in the Dead Marshes.1 His capture alarmed Sauron, causing him to send the Nazgûl out to attack the deserted ruins of Osgiliath and hunt for the Ring. Sauron had two purposes in making this assault: First, to test the strength and preparedness of Denethor (which was found to be greater than he hoped); and second (and more importantly) to make the appearance of the Nazgûl seem to be only part of his war policy against Gondor, in order to conceal from the Wise their mission to hunt for the One Ring.2
 The Battle
At the Council of Elrond, Boromir recounted this battle as a sudden attack in which the men of Gondor were outnumbered by the forces of Mordor with their allies, the Easterlings and Haradrim. However, he attributed Gondor's defeat to a power that had not been felt before, issuing from a great black horseman. Only a remnant of Gondor's eastern force survived. The last bridge across the Anduin was defended by a company led by Boromir and Faramir until the structure was destroyed. Only the two brothers and two others survived by swimming.3
The battle allowed the Black Riders to set forth and search for the One Ring in the west.
News of the defeat and the Black Shadow reached Eriador and the borders of the Shire by the end of June. Gandalf had an uneasy feeling when he got those messages and when he talked with refugees from the South he felt that they had a fear of which they didn't talk.3
It was the first conflict of the War of the Ring. Sauron found Denethor's forces stronger than he expected.2 For months thereafter Sauron continued to amass his forces in Mordor preparing for a full assault against Gondor.4 However when he discovered the Heir of Isildur, his plans were altered5 and proceeded hastily with his ready forces; another skirmish occurred in Osgiliath leading up to the Siege of Gondor.