I have been reading an introductory text in mathematical logic (Holden, 1995). The final chapter presents the resolution of Hilberts's tenth problem concerning the integer roots of an arbitrary polynomial over $\mathbb Z$.
The resolution (to the negative) follows from a theorem of Yuri Matiyasevich which tells us that every recursively enumerable relation/function is Diophantine.
On the one hand, it is not surprising that a resolution comes via mathematical logic - after all, it is a decidability problem. On the other hand, it is a very natural question with a long history whose resolution is of fundamental importance to Diophantine analysis.
Q: What are some examples of mathematical logic being successfully applied elsewhere?
Rightly or wrongly, I consider set theory to be a part of mathematical logic, so, for example, the CH independence proofs of Cohen and Gödel I am considering to be part of logic.