Command is not a subtle spell, unless you do something about it. The victim must do as you say, but the wording of the spell suggests this is a mental compulsion, not a persuasion effect where the target somehow "agrees" with the outcome (compare this to the 2nd level spell Suggestion). They likely will figure out what just happened. Onlookers might be confused, but may also figure things out unless you make it difficult for them.
I think by the book, you would need to be very careful to avoid obvious suspicion of using magic - if nothing else it would be very odd for a hostile leader with no history of being a coward to suddenly capitulate when shouted at.
I might require a Deception roll in order to have the Command to appear to of happened in a mundane, social manner to onlookers as opposed to magical compulsion. Observers could use Arcana or Insight with an opposed check to pick up on clues and see through the deception.
The effects of a successful Command are very temporary (one round), the target will be aware they have been compelled, and usually will themselves want to correct the problems it has caused. However, with the right social setup it could be played on for better advantage - perhaps they do not want to lose face and admit that your magic was greater than their famous iron will?
In my opinion, the best result for commanding the opposition leader to surrender would be that they themselves surrender, but do not order their allies to do so (it is a compulsion with specific results, not a suggestion or longer-term control). If done in a believable manner, this may cause their own allies to be confused for a round, and maybe follow along surrendering themselves. This might give them such a disadvantage compared to the PCs that they remain surrendered for good reasons even when the affected leader recovers. However, once the spell's duration is over, you have no way to maintain the secrecy unless you somehow silence the leader or use some other spell to maintain the effect (even another Command could do the trick - perhaps "Grovel!")
If you can, use the Suggestion spell instead when you need a longer-term and more subtle effect.