We use smoothed particle hydrodynamics simulations with an approximate radiative cooling prescription to model the evolution of a massive (∼100 au) very young protoplanetary disc. We also model dust growth and gas-grain dynamics with a second fluid approach. It is found that the disc fragments into a large number of ∼10MJ clumps that cool and contract slowly. Some of the clumps evolve on to eccentric orbits, delivering them into the inner tens of au, where they are disrupted by tidal forces from the star. Dust grows and sediments inside the clumps, displaying a very strong segregation, with the largest particles forming dense cores in the centres. The density of the dust cores in some cases exceeds that of the gas and is limited only by the numerical constraints, indicating that these cores should collapse into rocky planetary cores. One particular giant planet embryo migrates inwards close enough to be disrupted at about 10 au, leaving a self-bound solid core of about 7.5 M⊕ mass on a low-eccentricity orbit at a radius of ∼8 au. These simulations support the recent suggestions that terrestrial and giant planets may be the remnants of tidally disrupted giant planet embryos.