Abstract. We are concerned with the linear-quadratic optimal stochastic control problem where all the coefficients of the control system and the running weighting matrices in the cost functional are allowed to be predictable (but essentially bounded) processes and the terminal state-weighting matrix in the cost functional is allowed to be random. Under suitable conditions, we prove that the value field V (t, x, ω), (t, x, ω) ∈ [0, T ] × R n × Ω, is quadratic in x, and has the following form: V (t, x) = Ktx, x where K is an essentially bounded nonnegative symmetric matrix-valued adapted processes. Using the dynamic programming principle (DPP), we prove that K is a continuous semimartingale of the formwith k being a continuous process of bounded variation and (2003), pp. 53-75] via the stochastic maximum principle with a viewpoint of stochastic flow for the associated stochastic Hamiltonian system. The present paper is its companion, and gives the second but more comprehensive (seemingly much simpler, but appealing to the advanced tool of Doob-Meyer decomposition theorem, in addition to the DDP) adapted solution to a general BSRE via the DDP. Further extensions to the jump-diffusion control system and to the general nonlinear control system are possible.Key words. linear quadratic optimal stochastic control, random coefficients, Riccati equation, backward stochastic differential equations, dynamic programming, semi-martingale AMS subject classifications. 93E20, 49K45, 49N10, 60H101. Formulation of the problem and basic assumptions. Consider the following linear quadratic optimal stochastic control (SLQ in short form) problem: minimize over u ∈ L