Answer
Between 1339 and 1342, Louis I of Hungary, the son of King Charles I, served as the Duke of Transylvania, a province in the Kingdom of Hungary. During his time as duke, Louis fought against the Mongols and other enemies of the kingdom. In 1342, he became King of Hungary, and Transylvania became a province of his kingdom.