Which branch of the US military was Robert E Lee serving in when he recaptured Harpers Ferry from John Brown and his associates?

In 1858, Robert E. Lee was serving as a colonel in the US Marines when he recaptured Harper's Ferry from John Brown and his associates.