The Battle of Hartville occurred over three days, beginning with the Confederate capture of a small Union garrison posted at Hartville on January 9, 1863. Union and Confederate troops in the area converged on Hartville in response, and the two sides clashed until January 11th when the Confederate force withdrew. Confederate Brigadier General John S. Marmaduke responded to news that a Union force was en route to rescue the Union captives and re-take Hartville, he directed his force to move to Hartville in hopes of taking the town before the Union garrisoned the town. Marmaduke was in the area as part of an effort to challenge the Union's continued control of Missouri. After failing to take Springfield, Marmaduke hoped to assault Union posts in and around Hartville. Instead, Union forced under Confederate Samuel Merril was able to secure a defensive position around Hartville and Marmaduke's men withdrew.
On January 9, 1863, Confederate forces under Colonel Joseph C Porter captured a garrison of about 40 Union soldiers at Hartville. On the next day, Porter's Confederates carried out raids on other Union posts throughout the area before combining his forces with General Marmaduke's men outside of Hartville. Marmaduke had received information that Union forces were drawing near and prepared his men for battle.
Marmaduke feared that he may be outflanked or encircled by what was at that time an unknown number of Union troops. Union forces under Colonel Merrill had little chance to encircle Marmaduke, but he was able to position his artillery on high ground where they could support an attack on the Confederates. Without taking stock of the situation, the Confederates began the attack against Merrill's men. These repeated attacks led to high casualties and were repulsed until the Confederates were able to concentrate their artillery on the Union battle line. This forced the Union to retreat, but Merill's men were able to retreat to the town and use defensive positions throughout the area to prevent Marmaduke from following up on his costly but successful assault.
While the Union troops under Merill retreated from the battlefield to the town, the 21st Iowa Infantry did not receive the order to retreat. These men stubbornly held their ground in the nearby woods and awaited the orders of Lieutenant Colonel Cornelius Dunlap. To hold off the Confederate advances, Dunlap ordered the men to spread out and increase their rate of fire. This helped to conceal his deficient numbers and allowed Dunlap to hold his position until nightfall. By that time, he was aware that he and his men were all alone, and together they escaped under the cover of darkness and rejoined Colonel Merrill and the other Union forces at Hartville.