Bible scholars and students are somewhat divided on this issue. I personally think he was a real man, who functions as a type of Christ. Scripture records no genealogical background (no mention of a father or mother) as with the Levite priests so that he might make a fitting type of Christ.
In Ps. 110:4 a Davidic king is acclaimed by divine oath as ‘a priest for ever after the order of Melchizedek’. The background of this acclamation is provided by David’s conquest of Jerusalem c. 1000 bc, by virtue of which David and his house became heirs to Melchizedek’s dynasty of priest-kings. The king so acclaimed was identified by Jesus and his contemporaries as the Davidic Messiah (Mk. 12:35ff.). If Jesus is the Davidic Messiah, he must be the ‘priest for ever after the order of Melchizedek’. This inevitable conclusion is drawn by the writer to the Hebrews, who develops his theme of our Lord’s heavenly priesthood on the basis of Ps. 110:4, expounded in the light of Gn. 14:18ff., where Melchizedek appears and disappears suddenly, with nothing said about his birth or death, ancestry or descent, in a manner which declares his superiority to Abram and, by implication, to the Aaronic priesthood descended from Abram. The superiority of Christ and his new order to the levitical order of OT times is thus established (Heb. 5:6-11; 6:20-7:28).
From Unger’s Bible Dictionary:
(“king of righteousness”). The king of Salem (i.e., Jerusalem) and “a priest of God Most High,” who went out to congratulate Abraham on his victory over Chedorlaomer and his allies. He met him in the “valley of Shaveh (that is, the King’s Valley).” Melchizedek brought bread and wine for the exhausted warriors and bestowed his blessing upon Abraham. In return the patriarch gave to the royal priest a tenth of all the booty taken from the enemy (Genesis 14:17-20), about 1970 b.c. Giving the tenth was a practical acknowledgment of the divine priesthood of Melchizedek, for the tenth was, according to the general custom, the offering presented to Deity. Melchizedek is mentioned in Psalm 110:4, where it is foretold that the Messiah would be “a priest forever according to the order of Melchizedek,” and in Hebrews 5:7, where these two passages of the OT are quoted and the typical relation of Melchizedek to our Lord is stated at great length. “According to the order of Melchizedek” (Psalm 110:4) is explained by Gesenius and Rosenmüller to mean “manner,” i.e., likeness in official dignity—a king and priest. The relation between Melchizedek and Christ as type and antitype is made in the epistle to the Hebrews to consist in the following particular: each was a priest (1) who is not of the Levitical tribe; (2) who is superior to Abraham; (3) whose beginning and end are unknown; (4) who is not only a priest, but also a king of righteousness and peace. “Without father,” etc. (Hebrews 7:3), refers to priestly genealogies. Melchizedek is not found on the register of the only line of legitimate priests; his father’s name is not recorded, nor his mother’s; no evidence points out his line of descent from Aaron. It is not affirmed that he had no father or that he was not born at any time or died on any day; but these facts were nowhere found on the register of the Levitical priesthood. Melchizedek offers an expressive type of Christ, the King-Priest, especially of the Messiah’s work in resurrection, inasmuch as the ancient character offers bread and wine, memorials of sacrifice. The writer to the Hebrews beautifully describes the everlasting continuance and kingly authority of Christ’s high priesthood by the phrase “according to the order of Melchizedek” (Hebrews 6:20; cf. 7:23-24). The priesthood, as handed down through the line of Aaron, was often set aside by death. The Melchizedek aspect of Christ’s priesthood portrays Christ in the perpetuity of His priestly office. “He always lives to make intercession” (Hebrews 7:25). Although the Aaronic priesthood could typify Christ’s priestly work, it was limited in portraying the full scope of His priestly ministry. The Melchizedek type supplements the Aaronic type. As “king of righteousness” and “king of … peace” (Hebrews 7:2; cf. Isaiah 11:4-9), Christ will in the coming Kingdom age assume both offices in His Person. The prophet Zechariah graphically sets this forth in the symbolic crowning of Joshua (Zechariah 6:9-15). This significant event foreshadowed the millennial period when Messiah the Branch will “sit and rule on His throne. Thus, He will be a priest on His throne, and the counsel of peace will be between the two offices” (Zechariah 6:13); that is, both kingship and priesthood will be united in one Person. m.f.u.
The following, taken from The Bible Knowledge Commentary, is an illustration of one who thinks Melchizedek was more than a man:
7:1-3. To begin with, the writer set forth the personal greatness of the Old Testament figure Melchizedek. As a fit prototype for Christ Himself, Melchizedek was both a king and a priest. He both blessed . . . Abraham and received his tithes. Melchizedek’s name and title suggest the messianic attributes of righteousness and peace. So far as the Old Testament record is concerned, he was without father or mother, without genealogy, without beginning of days or end of life. In saying this, the author is often taken to mean that the silence of the inspired record presents Melchizedek as typologically like the Son of God. But though this is possibly true, the statements do not sound like it, particularly the assertion that Melchizedek remains a priest forever. The word “forever” translates a phrase (eis to dienekes) that occurs only in Hebrews (here and in 10:12, 14) and means “continuously” or “uninterruptedly.”
It seems more natural that the author meant that Melchizedek belonged to an order in which there was no end to the priesthood of those engaged in it. (He later said in 7:8 that Melchizedek “is declared to be living.”) If this is correct, Melchizedek may have been an angelic being who reigned for a time at Salem (i.e., Jerusalem). If so, the statement that he was “without beginning of days” would not mean that he was eternal, but simply that he had a pretemporal origin. Nor would this concept of Melchizedek as an angel elevate him to the same level as God’s Son, since the author painstakingly asserted the Son’s superiority to the angels (1:5-14). There is indeed evidence that, at Qumran, Melchizedek was regarded as an angelic personage. If this is the case in Hebrews, then the Son of God is the High Priest in an order in which Melchizedek is simply a priest.