The literal translation of "to speak a language fluently" would be hablar un idioma con fluidez, but I have heard that means that you speak the language fluidly and smoothly rather than that you have mastered the language itself. What is the best way in Spanish to express that you are "fluent" in a language, in the English sense of having mastered that language and being able to speak/read/write/understand it accurately?
You can say that a person is "elocuente". It means the person communicates a message efficiently by means of the spoken language, which is only possible when a certain level of mastery has been reached:
John es elocuente en español.
John habla español con elocuencia.
An alternative is the word "dominio" (mastery), or just say that the level is (very) advanced:
John domina el español.
John maneja el español de manera avanzada.
John tiene un nivel muy avanzado de español.