At the age of 16, he entered the University of Virginia, where he shot a fellow student. Mosby was imprisoned, but the attorney who prosecuted him helped him during this confinement in the study of law. After he was released from prison, he practiced law at Bristol, Virginia. While there, he married Pauline, daughter of Beverely J. Clarke, of Kentucky, prominent in the United States Congress, and the diplomatic service.
When Virginia secceeded, he immediately enlisted in the Washington Mounted Rifles, under Capt. William E, Jones. When Jones became Colonel of the 1st Virginia Cavalry, he was appointed adjutant of the regiment, with the rank of lieutenant. When Jones was transferred to another regiment, Mosby was invited by Brigadier Gen. J.E.B. Stuart to remain with him as a scout, and, in this capacity, he made a reconnaissance prepatory to Stuart's famous Chickahominy raid, and as guide led that expedition.
En route to join Brigadier Gen. Thomas J. Jackson, he was captured but was exchanged in time to give Gen. Robert E. Lee the information of Gen. Ambrose Burnside's movement toward Fredericksburg, and served with Stuart in the 2nd Bull Run and Maryland campaigns. After his release in July 1862, he rejoined Stuart and was rewarded with the authority to raise a band of partisans for service in the Loudoun Valley in northern Virginia. Originally a battalion, his command was raised to a regiment in the last months of the war. Lee, in his report of Confederate successes during the winter, noticed that Mosby had done much to harass the enemy, attacking him boldly on many occasions and capturing many prisoners. In the meantime, he managed to wreak havoc among the Union supply lines, forcing field commanders to detach large numbers of troops to guard their communications. His forays took him within the lines guarding Washington, D.C., with Mosby himself often doing the advance scouting in disguise.
While independent, his command was always part of the cavalry of the army, and he made reports regularly to Stuart or Lee. His mode of warfare was to cut off the Union's supplies and disturb the communications. Often large forces were sent against him, but he always evaded and frequently defeated them, capturing many prisoners. In March, 1863, he captured the Gen. Edwin H. Stoughton, in camp near Fairfax, and a number of his men.
One of his most daring adventures was a reconnaissance in the Union lines, by order of Lee, after the battle of Chancellorsville, in which he and one companion captured 6 men, and with 2 of them, rode undetected past a column of Federal cavalry. On another occasion, he rode in sight of Washington, D.C., and by a countryman, sent President Lincoln a lock of his hair, a token which Lincoln's keen sense of humor fully appreciated. In addition to the numberless encounters along the border, he was of valuable service to Stuart in all his famous raids, including the movement into Pennsylvania, preceding the battle of Gettysburg. Another very important service was his defeat of Gen. Philip Sheridan's plan to join Gen. Ulysses S. Grant, in the fall of 1864, by rendering it impossible for the Federals to rebuild the Manassas Gap Railroad, necessary to furnish Sheridan supplies and transportation.
The disruption of supply lines and the constant disappearance of couriers frustrated army, and lesser-group, commanders to such a degree that some took to the summary execution of guerrillas, i.e. partisan rangers. George Custer executed 6 of Mosby's men in 1864, and the partisan chief retaliated with 7 of Custer's. A note attached to one of the bodies stated that Mosby would treat all further captives as prisoners of war unless Custer committed some new act of cruelty. The killings stopped.
With Lee's s urrender, Mosby simply disbanded his command on April 20, 1865, rather than formally surrender. While the partisans were certainly a nuisance to Union commanders, it is an open question as to how effective they were in prolonging the conflict. Many Southerners were very critical of the partisans, only some Southerners excepting Mosby's command.
His subsequent life was influenced greatly by the strong friendship between him and the great general who had ordered his honorable parole. Not pardoned until 1866, Mosby practiced law and befriended Grant. He supported the candidacy of Grant for the presidency as the best way to restore amity in the Union, but declined office.
He received an appointment as U.S. consul in Hong Kong and other government posts under the administration of President Hayes, he won distinction by the official life. Subsequently, he returned to the practice of law and made his residence at San Francisco.