There are various surgical methods for tracheoesophageal fistula; however, there is presently no unified standard. Based on the magnetic compression technique, we designed a novel method for the treatment of tracheoesophageal fistula. The purpose of this study was to verify its feasibility in an animal experiment. Six beagle dogs underwent surgical repair after constructing a tracheoesophageal fistula model. After the tracheal and esophageal spaces were freed during the operation, two magnets were used to clamp the fistula. The operation time, intraoperative blood loss, postoperative complications, and wound healing were monitored. Samples were obtained 14 days after the operation, and fistula repair was observed. The tracheoesophageal fistula repair operation was successfully completed for all six beagles. The average operation time was 23.67 ± 4.50 min. The average intraoperative blood loss was less than 10 mL. One dog had a postoperative wound infection, and the rest had no postoperative complications. The wound healed well. In all dogs, after specimen collection, it was observed that the fistula was successfully closed and the mucosal layer was smooth and flat. Histological observation showed that the anastomosis was slightly inflamed, the mucosal layer and surrounding tissues were arranged neatly, and the structure was slightly disordered. Magnetic compression technique can be effectively used to repair tracheoesophageal fistula, shorten the operation time, and simplify the operation procedure, and thus, it has the potential for clinical application.