Stellar photometry in nine fields around the giant elliptical galaxy M87 in the Virgo cluster is obtained from archival images of the Hubble Space Telescope. The resulting Hertzsprung--Russell diagrams show populated red-giant and AGB branches. The position of the tip of the red-giant branch (the TRGB discontinuity) is found to vary with galactocentric distance. This variation can be interpreted as the effect of metal-rich red giants on the procedure of the measurement of the TRGB discontinuity or as a consequence of the existence of a weak gas-and-dust cloud around M87 extending out to $10^prime$ along the galactocentric radius and causing $I$-band absorption of up to $0.^m2$ near the center of the galaxy. The TRGB stars located far from the M87 center yield an average distance modulus of $(m-M) = 30.91pm0.08$, which corresponds to the distance of $D=15.4pm0.6$ Mpc. It is shown that stars in the field located between M86 and M87 galaxies at angular separations of $37^prime$ and $40^prime$ are not intergalactic stars, but belong to the M87 galaxy, i.e., that the stellar halo of this galaxy can be clearly seen at a galactocentric distance of 190 kpc. The distances are measured to four dwarf galaxies P4anon, NGC4486A, VCCA039, and dSph-D07, whose images can be seen in the fields studied. The first three galaxies are M87 satellites, whereas dSph-D07 is located at a greater distance and is a member of the M86 group.