Presumably it was Riemann himself who proved the sufficiency of $R=0$ for the flatness. Spivak's Chapter 4 in Volume II of "A comprehensive introduction to differential geometry" is a good source on Riemann's work. It gives a translation of Riemann's inaugural lecture and of a part of his prize essay. At the end of the prize essay Riemann says (I am citing from Spivak):
Given an acquaintance with the traditional methods, it is demonstrated without difficulty that these ... conditions when they are satisfied, suffice...
meaning the vanishing of the components of the curvature tensor. Later in Chapter 4, Spivak gives a proof of this claim by a method that could have been considered "traditional" by Riemann.
I don't know however who was historically the first to publish a proof of this, but I would look rather not for a paper but for a textbook.