Peter's denial of the Lord and the fact that he uttered curses is well known. But there is some ambiguity grammatically as to intended recipient of the curse. At least three options are possible: (1) Peter himself, (2) the bystanders, or (3) the Lord. Of the three, the bystanders view seems least likely since it would not really be a denial of the Lord. On the other hand, I have taught that Peter was uttering a self-imprecation, that is, calling a curse(s) upon himself as a way of bolstering the veracity of his denial. But R. T. France has made a really strong case that Peter's denial involved the Lord. If so, it certainly magnifies the grace extended to Peter, one who not only denied knowing the Lord but actually uttered an imprecation against him! In any case, here is the pertinent part of France's comments on Matthew 26:74.
"Again Peter denies, and again he uses an oath. But this time Matthew’s wording goes further, and the verb “began” indicates a new element in this third denial. The verb “swear” alone would have indicated merely another oath as in v. 72, but it is preceded by katathematizō, a verb which occurs only here but is generally agreed to be synonymous with the verb used in the Marcan parallel, anathematizō, “to curse, anathematize” (and in the LXX “to devote,” especially to destruction). Anathematizō elsewhere is always a transitive verb requiring a direct object to denote the person cursed; cf. Paul’s use of anathema as a curse formula in 1 Cor 12:3; 16:22; Gal 1:8, 9, in each case applied to a person other than the speaker. If the verb here meant, as some versions have suggested, that Peter is putting himself under a curse if he is lying, it would require “himself” as object, as it has in Acts 21:12, 14, 21. Here, where the object is not expressed, it means that Peter is cursing someone other than himself, and the most natural sense in this context would be that he now began to curse Jesus, as a way of dissociating himself from him; this was precisely what Pliny later required those accused of being Christians to do, in order to prove their innocence (Pliny, Ep. 10.96.5; cf. also Justin, Apol. 1.31.6). Matthew and Mark, by leaving the object unexpressed, refrain from stating in so many words that Peter cursed Jesus, but it is hard to see what else the choice of these transitive verbs could be meant to convey."
R. T. France, The Gospel of Matthew, NICNT (Grand Rapids: Eerdmans 2007), 1033–1034.