I was reading a book(fiction) recently and a kidnapping happened. A woman escaped and ran into several people. One of them being a soldier with his wife. As the kidnapper tries to find the escaped woman, he also runs into these people. The wife wants to call the police, but the soldier says he doesn't want the guy leaving before they get there. Then he said "I'm on active duty and I'm tasked with upholding federal law".
Is this in any way true? Can a soldier act as a law enforcement officer in a situation like this? I'm aware there is a law that states the military can't operate on U.S. soil, but I feel like the author of the book knows something I don't.