Recent research demonstrated that exposure of mice to both inhomogeneous (3–477 mT) and homogeneous (145 mT) static magnetic fields (SMF) generated an analgesic effect toward visceral pain elicited by the intraperitoneal injection of 0.6% acetic acid. In the present work, we investigated behavioral responses such as writhing, entry avoidance, and site preference with the help of a specially designed cage that partially protruded into either the homogeneous (ho) or inhomogeneous (inh) SMF. Aversive effects, cognitive recognition of analgesia, and social behavior governed mice in their free locomotion between SMF and sham sides. The inhibition of pain response (I) for the 0–5, 6–20, and 21–30 min periods following the challenge was calculated by the formula I = 100 (1 − x/y) in %, where x and y represent the number of writhings in the SMF and sham sides, respectively. In accordance with previous measurements, an analgesic effect was induced in exposed mice (Iho = 64%, P < 0.0002 and Iinh = 62%, P < 0.002). No significant difference was found in the site preference (SMFho, inh vs. sham) indicating that SMF is neither aversive nor favorable. Comparison of writhings observed in the sham versus SMF side of the cage revealed that SMF exposure resulted in significantly fewer writhings than sham (Iho = 64%, P < 0.004 and Iinh = 81%, P < 0.03). Deeper statistical analysis clarified that the lateral SMF gradient between SMF and sham sides could be responsible for most of the analgesic effect (Iho = 91%, P < 0.02 and Iinh = 54%, P < 0.02). Bioelectromagnetics 34:385–396, 2013. © 2012 Wiley Periodicals, Inc.