This is a somewhat complicated question, as it depends on close understanding of Greek terms. When we initially encounter Oedipus in Sophocles' play, he is a ruler by popular acclaim. The term for this in Greek is actually "tyrannos" (tyrant); the Greek title of the play is not "Oedipus the King" but "Oedipus the Tyrant". It is only at the very end of the play, when we discover that Oedipus was the son of Jocasta and Laius that it is revealed that Oedipus was actually the hereditary monarch (basileus) or king of Thebes.
At the beginning of the play, Oedipus is an intelligent adult, and dedicated ruler, albeit with a tendency towards arrogance. As the play develops, and Oedipus discovers that he has married his mother and killed his father, he attains a degree of wisdom, humility, and remorse, that is more fully developed in a subsequent play by Sophocles, "Oedipus at Colonus".