A surgical stapler is provided that maintains the jaws of the stapler in an open position and prevents firing of staples when a cartridge is not loaded in one of the jaws. Distinct positioning and sequencing of the jaws, capture pin and firing of the staples are provided by a latch mechanism. Such locking and latching mechanisms ensure proper operation of the stapler.