Summary: Efficient numerical algorithms are proposed for a class of forward-backward stochastic differential equations (FBSDEs) connected with semilinear parabolic partial differential equations. As in [{\it J. Douglas jun., J. Ma} and {\it P. Protter}, Ann. Appl. Probab. 6, No. 3, 940--968 (1996;

Zbl 0861.65131)], the algorithms are based on the known four-step scheme for solving FBSDEs. The corresponding semilinear parabolic equation is solved by layer methods which are constructed by means of a probabilistic approach. The derivatives of the solution $u$ of the semilinear equation are found by finite differences. The forward equation is simulated by mean-square methods of order 1/2 and 1. Corresponding convergence theorems are proved. Along with the algorithms for FBSDEs on a fixed finite time interval, we also construct algorithms for FBSDEs with random terminal time. The results obtained are supported by numerical experiments.