First Battle of Winchester

The First Battle of Winchester was fought on May 25, 1862, in and around Frederick County and Winchester, Virginia during the American Civil War. The battle was a victory in Confederate Army Major General Thomas J. "Stonewall" Jackson's Campaign through the Shenandoah Valley. Jackson enveloped the right flank of the Union Army under Major General Nathaniel P. Banks. The Union forces retreated across the Potomac River into Maryland. Due to confusion among Confederate commanders, Jackson was unable to pursue Banks into Maryland.
Background.
At the beginning of 1862, President Abraham Lincoln wanted his generals to attack in force against the Confederacy. Major General George B. McClellan was massing his army for his Peninsula Campaign with the goal of capturing the Confederate capital of Richmond, Virginia and ending the war. To do this McClellan had to weaken his forces protecting Washington, D.C.. This left only two Union forces to protect Washington. Besides Banks in the Shenandoah Valley, General Irwin McDowell had forces in Northern Virginia. Banks was to clear the Shenandoah Valley of Confederate forces, then move up towards Washington so McDowell's force of 30,000 could move against Richmond from the north. 
Confederate General Stonewall Jackson was given the task of keeping the Federal Army busy in the Valley so they could not join McClellan. Jackson was defeated at the First Battle of Kernstown on March 23, 1862. In spite of the loss, Jackson did gain a strategic victory. It kept Banks in the Valley and prevented McDowell from sending troops to McClellan's Peninsula Campaign.
On April 17, the weather cleared and Banks started moving south towards Harrisonburg. At about this time the strategic situation changed for the Confederacy. General Joseph E. Johnston had moved to the Peninsula taking 55,000 Confederate soldiers to defend against McClellan's 110,000 troops. Confederate general Richard S. Ewell's division was now between Johnson on the Peninsula and Jackson in the Valley and could support either as the need arose. So Jackson no longer needed to keep Union forces in the Valley from joining McClellan, he now wanted to force them out of the Shenandoah Valley completely.
On April 25, Banks' Union force occupied Harrisonburg. Jackson withdrew to Swift Run Gap (about 20 miles East of Harrisonburg). This put him in a position to outflank Banks if the Union forces moved any further south and allowed him to stay in contact with Ewell's Confederate division if he needed support. Meanwhile a Union brigade under Robert H. Milroy was at the village of McDowell, Virginia which threatened Jackson's supply depot at Staunton. Jackson left Ewell at Swift Run Gap to move against Milroy. 
On May 8, Jackson's forces attacked Milroy's Union forces at McDowell. It was a Union tactical victory because the Union forces had fewer casualties than Jackson's forces. But it was a strategic victory for Jackson because the Union forces withdrew back across the Allegheny Mountains ending the threat. Jackson returned to the Shenandoah Valley and decided that his and Ewell's command would now deal with Banks. In turn, Banks anticipated Jackson's move and asked permission to leave Strasburg and move north, but it was denied. Earlier, on May 1, Lincoln had ordered one of Banks' divisions to join the Union forces at Fredericksburg under General McDowell. This weakened Banks's forces but he believed Jackson had left the Valley. On learning Milroy had been driven back at McDowell, Banks sent his 1st Maryland Infantry division to Front Royal, Virginia (about 12 miles to the east) to protect his left flank.
Jackson had intended to move against Banks at Strasburg. But when he learned there were Union infantry at Front Royal, he decided to attack there first. On May 23, at the Battle of Front Royal, Jackson's Confederates captured the town of Front Royal, along with most of the 900 Union soldiers who defended it. Realizing Jackson was now on his flank and he had no support at Front Royal, on May 24 Banks retreated to Winchester. Because of the good protection provided by his rearguard and poor communications between Jackson and Ewell, Banks was able to reach Winchester with minimal losses.
The battle.
When Banks arrived at Winchester, he started organizing his defenses. On May 25, Jackson's first attack was thrown back. Ewell approached Winchester from the southwest with his division and attacked Camp Hill (now Overlook Park in the southeastern part of Winchester). At the same time Jackson's Louisiana Brigade outflanked, then overran the Union position on Bower's Hill (southwestern part of Winchester). With their flanks broken, the Union troops began a disorganized retreat through the city of Winchester. Even citizens of Winchester fired on the Union soldiers. Banks retreated across the Potomac River back into Maryland. This was the decisive victory for Jackson's Valley Campaign.
Aftermath.
Jackson lost about 68 killed and 329 wounded. Banks Union casualties were approximately 62 killed, 243 wounded and over 1,700 captured or missing. 
Jackson's infantry was too tired to keep up with the retreating Union soldiers. His cavalry, led by Colonel Turner Ashby, was completely useless. They had started looting the abandoned and damaged Union wagons for supplies and had broken off from fighting. Confederate General J.E.B. Stuart's cavalry was attached to Ewell's forces. But they could not be found in time. Once they were located, Stuart refused Jackson's order and waited for the order to come through Ewell. Jackson won a victory at Winchester, but could not finish off his enemy.
The defeat of Banks caused great concern in Washington. President Lincoln ordered McDowell to send 20,000 men to help deal with the situation in the Shenandoah Valley. These were troops McClellan needed in his Peninsula Campaign. For the next few weeks, Jackson continued to defeat Union efforts at the Battles of Cross Keys and Port Republic in June 1862.