When Virginia seceded from the Union and joined the Confederacy, it seized the Norfolk Naval Shipyard. Although the shipyard had been ordered to destroy all of the ships to prevent them from falling into Confederate hands, a steam frigate called the USS Merrimack had been sunk before being allowed to fully burn. This meant that the Confederates were able to raise it and use the engine and hull to make an ironclad steamer. They renamed this new ship the CSS Virginia.
Ironclads were a very new invention and their successful use in the Civil War could have disrupted the Union blockade of Southern ports. Because the ship was covered in four inches of iron on all sides, it was virtually impervious to the cannon balls fired by the Union ships. On the other hand, the Virginia posed a serious threat to wooden Union ships and could either ram them or shoot them with its deck mounted guns. Fearing that the Confederates would break the blockade with this ironclad, Congress authorized the construction of three of their own ironclads. One of the ships produced in this effort was the USS Monitor.
On March 8th, 1862, the Virginia sailed out of the mouth of the James River and directly attacked five union warships. It sunk the USS Congress and the USS Cumberland and killed over 240 of their crew. The Virginia planned to attack the USS Minnesota, which had run aground, next. The ironclad could not reach the Minnesota, however, because the water was too shallow. The Virginia retired, planning to return for the rest of the fleet the next day.
As planned, the Virginia returned for the Minnesota the next day. When it did, however, it encountered the USS Monitor. The Monitor was a much smaller, more maneuverable ship than the CSS Virginia, but neither ship had much of an advantage in the fight. After hours of fighting, both ships were only slightly damaged. The Virginia had lost a smokestack, reducing its already limited mobility, and the Monitor experienced problems firing and arming is guns that already too weak to do much damage to thick hull of the Virginia.
After hours a fighting, the Virginia managed to hit the Monitor's pilothouse, blinding its commander. The Monitor had to retire so he could be replaced and by that time the Virginia was gone. The battle ended in a stalemate. The Virginia tried to engage the Monitor on several occasions later on, but neither ship engaged any ship after their first meeting. When the Union recaptured Norfolk, the Confederate navy ordered the Virginia to be destroyed to prevent it from falling into enemy hands.
Though the meeting of the two ironclads ended in a stalemate, it was actually a victory for the Union army. It meant that the Confederacy would be unable to break the Union blockade, which it desperately needed to do to be able to export cotton to raise revenue. Thus, the Monitor's success at keeping the Virginia from being used effectively during the war probably shortened the course of the entire war.