The invention relates to medicine and veterinary applications, in particular, as a means for effective control of acute and/or chronic pain, and may be used in emergency medicine for the treatment of acute and/or chronic pain, including the late stages of cancer. The stated means is based on a compound for preventing and/or treating acute or chronic pain in a subject, comprising an analgesic peptide having an amino acid sequence H-Tyr-D-Arg-Phe-Gly-NH2 or an amino acid sequence H-Tyr-D-Arg-Phe-Sar-OH. Also, a method of use of the compound for the prevention and/or treatment of acute and/or chronic pain is disclosed.