BREX (for BacteRiophage EXclusion) is a superfamily of common bacterial and archaeal defence systems active against diverse bacteriophages. While the mechanism of BREX defence is currently unknown, self versus non-self differentiation requires methylation of specific asymmetric sites in host DNA by BrxX (PglX) methyltransferase. Here, we report that T7 bacteriophage Ocr, a DNA mimic protein that protects the phage from the defensive action of type I restriction–modification systems, is also active against BREX. In contrast to the wild–type phage, which is resistant to BREX defence, T7 lacking Ocr is strongly inhibited by BREX, and its ability to overcome the defence could be complemented by Ocr provided in trans. We further show that Ocr physically associates with BrxX methyltransferase. Although BREX+ cells overproducing Ocr have partially methylated BREX sites, their viability is unaffected. The result suggests that, similar to its action against type I R–M systems, Ocr associates with as yet unidentified BREX system complexes containing BrxX and neutralizes their ability to both methylate and exclude incoming phage DNA.