This paper considers the mode selection problem for network-assisted device-to-device (D2D) communications with multiple antennas at the base station. We study transmission in both dedicated and shared frequency bands. Given the type of resources (i.e., dedicated or shared), the user equipment (UE) decides to transmit in the conventional cellular mode or directly to its corresponding receiver in the D2D mode. We formulate this problem under two different objectives. The first problem is to maximize the quality-of-service (QoS) given a transmit power, and the second problem is to minimize the transmit power given a QoS requirement. We derive closed-form results for the optimal decision and show that the two problem formulations behave differently. Taking a geometrical approach, we study the area around the transmitter UE where the receiving UE should be to have D2D mode optimality, and how it is affected by the transmit power, QoS, and the number of base station antennas.