We combine transcendental methods and the modular approaches to the $ABC$ conjecture to show that the largest prime factor of $n^{2}+1$ is at least of size $(\log _{2} n)^{2}/\log _{3}n$ where $\log _{k}$ is the $k$ -th iterate of the logarithm. This gives a substantial improvement on the best available estimates, which are essentially of size $\log _{2} n$ going back to work of Chowla in 1934. Using the same ideas, we also obtain significant progress on subexpoential bounds for the $ABC$ conjecture, which in a case gives the first improvement on a result by Stewart and Yu dating back over two decades. Central to our approach is the connection between Shimura curves and the $ABC$ conjecture developed by the author.