I-45 was temporarily shut down in both directions in Montgomery County while police took a man with a gun into custody.