Algorithms are now playing a central role in digital marketplaces, setting prices and automatically responding in real time to competitors’ behaviour. The deployment of automated pricing algorithms is scrutinized by economists and regulatory agencies, concerned about its impact on prices and competition. Existing research has so far been limited to cases where all firms use the same algorithm, suggesting that anti-competitive behaviour might spontaneously arise in that setting. Here we introduce and study a general anti-competitive mechanism, adversarial collusion, where one firm manipulates other sellers that use their own pricing algorithm. We propose a network-based framework to model the strategies of pricing algorithms on iterated two-firm and three-firm markets. In this framework, an attacker learns to endogenize competitors’ algorithms and then derive a strategy to artificially increase its profit at the expense of competitors. Facing a drastic loss of profits, competitors will eventually intervene and revise or turn off their pricing algorithm. To disincentivize this intervention, we show that the attacker can instead unilaterally increase both its profits and the profits of competitors. This leads to a collusive outcome with symmetric and supra-competitive profits, sustainable in the long run. Together, our findings highlight the need for policymakers and regulatory agencies to consider adversarial manipulations of algorithmic pricing, which might currently fall outside of the scope of current competition laws. Online commerce is increasingly relying on pricing algorithms. Using a network-based approach inspired by adversarial machine learning, a firm can learn the strategy of its competitors and use it to unilaterally increase all firms’ profits. This approach, termed as ‘adversarial collusion’, calls for new regulatory measures.