It was originally was written in 1674 by Thomas Ken, a priest in the Church of England. My old Baptist church when I was young sang it as the Doxology; after the hymns were sang; but it had a different rhythm (I like the new one above) like this one: