The purpose of this study was to evaluate the effect of a hydrogel spacer on intrafractional prostate motion during CyberKnife treatment. The retrospective study enrolled 24 patients (with the hydrogel spacer = 12, without the hydrogel spacer = 12) with two fiducial markers. Regarding intrafractional prostate motion, the offset values (mm) of three axes (X‐axis; superior [+] to inferior [−], Y‐axis; right [+] to left [−], Z‐axis; posterior [+] to anterior [−]) obtained from fiducial markers position between a digitally reconstructed radiographs images and live images in the Target Locating System were used, and extracted from generated log files. The mean values of the offset and each standard deviation were calculated for each patient, and both the groups were compared. For all the patients, a total of 2204 offset values and timestamps (without the hydrogel spacer group: 1065, with the hydrogel spacer group: 1139) were recorded for the X‐, Y‐, and Z‐axes, respectively. The offset values (mean ± standard deviation) for the X‐, Y‐, and Z‐axes were −0.04 ± 0.92 mm, −0.03 ± 0.97 mm (
P
= 0.66), 0.02 ± 0.51, −0.02 ± 0.49 mm (
P
= 0.50), and 0.56 ± 0.97 mm, 0.34 ± 1.07 mm (
P
= 0.14), in patients inserted without or with the hydrogel spacer, respectively. There was no effect of a hydrogel spacer on the intrafractional prostate motion in the three axes during CyberKnife treatment for prostate cancer.