What Western Did Humphrey Bogart Play in As A Bad Guy?

We all know Bogey played many bad guys in his career and, many other roles but, he rarely did a western.
Ok so, here's some hints:
It took place near the end of the Civil War.
It starred Randolph Scott and, Errol Flynn
It was just on TCM.