The answer will depend on how much philosophical charity you wish to grant to a given author, but the concept pre-dates the current era by at least 300-400 years.
The oldest likely candidate is Ruism (Confucianism), dating back to the 6th century BCE. Confucius hints at this idea by implication: Ruism elevates altruism as a key virtue of human beings, and therefore also government officials and rulers. Importantly, however, there's still plenty of room to read the relationship in the opposite direction: that the people exist to serve and protect the government, not the other way around. Confucianism is burdened with metaphysical baggage very reminiscent to the concept of the 'divine right of kings' which holds that a king's subjects owe fealty, service, and their lives to the monarch because that is how the universe was deliberate constructed. It's not immediately obvious that Confucius sees the people as the end towards which the means of altruism ("Ren") is aimed, since the whole construction is centered around achieving harmony with the universe.
The oldest definitive example is Plato's Republic which, despite advocating for the rise of philosopher-kings (a dictator with supreme power), clearly holds the wellbeing of the people to be the ends to which government is a means. Plato goes on, at length about how the interests of a ruler are at odds with the interests of their people, for example:
Because you fancy that the shepherd or neatherd fattens of tends the sheep or oxen with a view to their own good and not to the good of himself or his master; and you further imagine that the rulers of states, if they are true rulers, never think of their subjects as sheep, and that they are not studying their own advantage day and night. Oh, no; and so entirely astray are you in your ideas about the just and unjust as not even to know that justice and the just are in reality another's good; that is to say, the interest of the ruler and stronger, and the loss of the subject and servant; and injustice the opposite; for the unjust is lord over the truly simple and just: he is the stronger, and his subjects do what is for his interest, and minister to his happiness, which is very far from being their own. Consider further, most foolish Socrates, that the just is always a loser in comparison with the unjust. First of all, in private contracts: wherever the unjust is the partner of the just you will find that, when the partnership is dissolved, the unjust man has always more and the just less. Secondly, in their dealings with the State: when there is an income tax, the just man will pay more and the unjust less on the same amount of income; and when there is anything to be received the one gains nothing and the other much. Observe also what happens when they take an office; there is the just man neglecting his affairs and perhaps suffering other losses, and getting nothing out of the public, because he is just; moreover he is hated by his friends and acquaintance for refusing to serve them in unlawful ways.
The idea that justice demands we set aside our own wellbeing for the sake of others' is the core spirit of the idea that government exists for the promotion of the citizenry's wellbeing, which is then later made explicit in Book 4:
...but that our aim in founding the State was not the disproportionate happiness of any one class, but the greatest happiness of the whole; we thought that in a State which is ordered with a view to the good of the whole we should be most likely to find Justice, and in the ill-ordered State injustice: and, having found them, we might then decide which of the two is the happier...
Another answer offers The Code of Hammurabi as an even older contender (17th century CE). The Code has even more metaphysical baggage than Ruism, however, since Hammurabi explicitly calls out glorification of, and prosperity for, rulers who advance the Code. In similar way as the Arthasashstra (2nd-3rd century BCE), it's not clear that Hammurabi's Code is not equally a 'manual for the most effective way to manage a population productively' as it could be a statement that the wellbeing of individual people/citizens are the ends to which government is a means. To the extent that Hammurabi insists that citizens know their rights and be able to avail themselves of the law, the whole thing still seems centered on 'so they can properly revere, serve, and bring prosperity to their king' as a central principle.