He entered the United States Military Academy at the age of 19 and graduated 33th in the class of 1843. Of the class' 39 members, 27 were living in 1861, 15 became General Officers of full rank in Union or Confederate armies. One was Ulysses S. Grant, who later married Dent's sister, Julia Dent.

Mexican War

In the Mexican War, he participated in the siege of Vera Cruz, the capture of San Antonio, and the battles of Churubuseo, where he was severely wounded, and Molino del Rey. He received brevets of 1st Lt. and Captain for gallant and meritorious conduct.

He served on the Pacific railroad survey, on frontier duty in Idaho, in removing the Seminole Indians, and at various points in Texas, Virginia, and Washington territory, until he joined the Yakima expedition in 1856.

Pacific Northwest

In August of 1856 Capt. Dent was detailed to construct a road between Fort Dalles and the new Fort Simcoe, 67 mile away. The road was completed in just over a month over difficult terrain. He participated in the Spokane expedition in Washington territory, was engaged in the combat of "Four Lakes" in 1858, in that of Spokane Plain in the same year, and in the skirmish on that river. After frontier duty at Fort Walla Walla (2) he became a member of the Snake River, Oregon, expedition, to rescue the survivors of the massacre of Sahnon Fall (1860). Between June and November 1861 Capt. Dent and Company B of the 9th U.S. Infantry were located at Fort Hoskins Oregon and Captain Dent was the fort commander. In November 1861 he was accused of involvement in a plot to turn over Fort Hoskins to "secessionists" which remained unproven.

U.S. Civil War

At the outbreak of the U.S. Civil War, he was a Captain in the 9th U.S. Infantry, stationed in San Francisco. In March 1863 he was promoted to Major, 4th U.S. Infantry and ordered to duty in the East. He was stationed in New York City and was in command of a regiment of the Army of the Potomac. He was called to suppress anticipated riots, from September 1863, till January 1864. He served as a member of the military commission for the trial of state prisoners from Jan to Mar 1864. Lt. Gen. Ulysses S. Grant (his brother-in-law) appointed him "Aide-de-Camp to the General-in-Chief," with the rank of Lt. Col. He remained Aide-de-camp during Grant's whole time as Lt. Gen, he was present in the battles and military operations of the Richmond campaign, and as military commander of the City of Richmond, and of the garrison of Washington, D. C., in 1865, and on the staff of the general-in-chief at Washington after 1866, as colonel, aide-de-camp, and secretary to President Grant during his first term. For his gallant and meritorious services in the field during the civil war he was brevetted brigadier general U. S. A. and brigadier general of volunteers.

Post War

At close of war he served briefly as military governor of Richmond and was made Brigadier General of Volunteers to rank from April 5, 1865, as well as a Brigadier General by brevet in the Regular Army. As a Colonel of staff he served as President Grant's military secretary until 1873, when he was assigned to the command of Fort Trumbull, New London, Connecticut with rank of Lieutenant Colonel. He retired as Colonel of the 3rd U.S. Artillery, 1 Dec 1883, "upon his own application, having served over 40 years."

He then established his residence in Washington, DC, but five years later moved to Denver, Colorado, where one of sons was practicing law. He died there 23 Dec 1892 and was buried with full military honors in Section 2, Grave 3844-WS, Arlington National Cemetery.

The inscription on his grave marker reciting his Regular Army rank of "Colonel, US Army," and ignoring his Volunteer rank. Because of the many Volunteer commissions issued from 1861 to 1865, many "old Army" officers prized their regular commissions above their temporary commissions of higher grade in the volunter service.