We present a hybrid routing protocol for both pure and hybrid ad hoc networks which uses the mechanisms of swarm intelligence to select next hops. Our protocol, Ad hoc Networking with Swarm Intelligence (ANSI), is a congestion-aware routing protocol, which, owing to the self-organizing mechanisms of swarm intelligence, is able to collect more information about the local network and make more effective routing decisions than traditional MANET protocols. Once routes are found, ANSI maintains routes along a path from source to destination effectively by using swarm intelligence techniques, and is able to gauge the slow deterioration of a link and restore a path along newer links as and when necessary. ANSI is thus more responsive to topological fluctuations. ANSI is designed to work over hybrid ad hoc networks: ad hoc networks which consist of both lower-capability, mobile wireless devices and higher-capability, wireless devices which may or may not be mobile. In addition, ANSI works with multiple interfaces and with both wired and wireless interfaces.Our simulation study compared ANSI with AODV on both hybrid and pure ad hoc network scenarios using both TCP and UDP data flows. The results show that ANSI is able to achieve better results (in terms of packet delivery, number of packets sent, end-to-end delay, and jitter) as compared to AODV in most simulation scenarios. In addition, ANSI achieves this performance with fewer route errors as compared to AODV. Lastly, ANSI is able to perform more consistently, considering the lower variation (measured as the width of the confidence intervals) of the observed values in the results of the experiments. We show that ANSI's performance is aided by both its superior handling of routing information and also its congestion awareness properties, though we see that congestion awareness in ANSI comes at a price.